Skip to content

Commit 051555a

Browse files
committed
Use flakes
1 parent 055a759 commit 051555a

2 files changed

Lines changed: 10 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,22 @@
1-
name: CI
2-
1+
name: ArrayFire CI
32
on:
43
push:
5-
branches: [master]
4+
branches:
5+
- master
66
pull_request:
7-
branches: [master]
7+
8+
env:
9+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
810

911
jobs:
1012
build:
11-
runs-on: macos-latest
12-
13+
runs-on: ubuntu-latest
1314
steps:
1415
- uses: actions/checkout@v4
1516
- uses: cachix/install-nix-action@v31
1617
with:
1718
nix_path: nixpkgs=channel:nixpkgs-unstable
1819
- run: nix-channel --update
1920

20-
- name: Install ArrayFire
21-
run: brew install arrayfire
22-
23-
- name: Set up GHC
24-
uses: haskell-actions/setup@v2
25-
with:
26-
ghc-version: '9.8.4'
27-
cabal-version: 'latest'
28-
29-
- name: Cache cabal store
30-
uses: actions/cache@v4
31-
with:
32-
path: ~/.cabal/store
33-
key: ${{ runner.os }}-cabal-${{ hashFiles('cabal.project', '*.cabal') }}
34-
restore-keys: |
35-
${{ runner.os }}-cabal-
36-
37-
- name: Configure
38-
run: cabal configure --flags="disable-default-paths disable-build-tool-depends" --extra-include-dirs=$(brew --prefix arrayfire)/include --extra-lib-dirs=$(brew --prefix arrayfire)/lib
39-
40-
- name: hspec-discover
41-
run: nix-shell -p ghc -p cabal-install --keep LD_LIBRARY_PATH --run 'cabal install hspec-discover'
42-
43-
- name: Build
44-
run: nix-shell -p ghc -p cabal-install --keep LD_LIBRARY_PATH --run 'cabal build'
45-
env:
46-
LD_LIBRARY_PATH: "/opt/arrayfire/lib:/opt/arrayfire/lib64"
47-
48-
- name: Nix build
49-
run: nix build
50-
env:
51-
LD_LIBRARY_PATH: "/opt/arrayfire/lib:/opt/arrayfire/lib64"
21+
- name: Build and run tests
22+
run: nix develop --command bash -c 'cabal test'

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
cabal-install
8585
doctest
8686
hsc2hs
87-
hspec-discover
87+
# hspec-discover
8888
nil
8989
# Formatters
9090
nixpkgs-fmt

0 commit comments

Comments
 (0)