Skip to content

Commit 74e92f7

Browse files
committed
Use nix
1 parent ad25ea2 commit 74e92f7

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,22 @@ jobs:
1717
AF_PREFIX: "/usr/local"
1818

1919
steps:
20+
- uses: cachix/install-nix-action@v31
21+
with:
22+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Cancel Previous Runs
25+
uses: styfle/cancel-workflow-action@0.9.1
26+
with:
27+
access_token: ${{ github.token }}
2028
- uses: actions/checkout@v4
2129

30+
- name: Nix channel update
31+
run: nix-channel --update
32+
33+
- name: Cabal install
34+
run: nix-env -iA pkgs.cabal-install -f .
35+
2236
- name: Install ArrayFire prerequisites
2337
run: |
2438
sudo apt-get update
@@ -30,28 +44,11 @@ jobs:
3044
chmod +x "$AF_INSTALLER"
3145
sudo "./$AF_INSTALLER" --exclude-subdir --prefix="$AF_PREFIX"
3246
33-
- name: Set up Haskell
34-
uses: haskell-actions/setup@v2
35-
with:
36-
ghc-version: "9.12"
37-
cabal-version: "latest"
38-
39-
- name: Cache cabal store
40-
uses: actions/cache@v4
41-
with:
42-
path: |
43-
~/.cabal/packages
44-
~/.cabal/store
45-
dist-newstyle
46-
key: ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project') }}
47-
restore-keys: |
48-
${{ runner.os }}-cabal-
49-
5047
- name: Update cabal package list
5148
run: cabal update
5249

5350
- name: Build
54-
run: cabal build all
51+
run: nix-shell -p ghc --run 'cabal build'
5552
env:
5653
PATH: "/usr/local/bin:${{ env.PATH }}"
5754
LD_LIBRARY_PATH: "/usr/local/lib"

0 commit comments

Comments
 (0)