Skip to content

Commit fe7a9d2

Browse files
committed
Use flakes
1 parent 055a759 commit fe7a9d2

2 files changed

Lines changed: 12 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,24 @@
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
16+
1517
- uses: cachix/install-nix-action@v31
1618
with:
1719
nix_path: nixpkgs=channel:nixpkgs-unstable
18-
- run: nix-channel --update
19-
20-
- name: Install ArrayFire
21-
run: brew install arrayfire
2220

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"
21+
- run: nix-channel --update
4722

48-
- name: Nix build
49-
run: nix build
50-
env:
51-
LD_LIBRARY_PATH: "/opt/arrayfire/lib:/opt/arrayfire/lib64"
23+
- name: Build and run tests
24+
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)