Skip to content

Commit 0562031

Browse files
committed
Add CI workflow
1 parent fa580dd commit 0562031

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
AF_VERSION: "3.10.0"
15+
AF_INSTALLER: "ArrayFire-v3.10.0_Linux_x86_64.sh"
16+
AF_URL: "https://arrayfire.s3.amazonaws.com/3.10.0/ArrayFire-v3.10.0_Linux_x86_64.sh"
17+
AF_PREFIX: "/usr/local"
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install ArrayFire prerequisites
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y libfreeimage-dev libatlas3-base libfftw3-dev cmake ocl-icd-libopencl1
26+
27+
- name: Download and install ArrayFire
28+
run: |
29+
wget -q "$AF_URL" -O "$AF_INSTALLER"
30+
chmod +x "$AF_INSTALLER"
31+
sudo "./$AF_INSTALLER" --exclude-subdir --prefix="$AF_PREFIX"
32+
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+
50+
- name: Update cabal package list
51+
run: cabal update
52+
53+
- name: Build
54+
run: cabal build all
55+
env:
56+
PATH: "/usr/local/bin:${{ env.PATH }}"
57+
LD_LIBRARY_PATH: "/usr/local/lib"

0 commit comments

Comments
 (0)