Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

env:
AF_VERSION: "3.10.0"
AF_INSTALLER: "ArrayFire-v3.10.0_Linux_x86_64.sh"
AF_URL: "https://arrayfire.s3.amazonaws.com/3.10.0/ArrayFire-v3.10.0_Linux_x86_64.sh"

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- run: nix-channel --update

- name: Nix channel update
run: nix-channel --update

- name: Install ArrayFire prerequisites
run: |
sudo apt-get update
sudo apt-get install -y gcc libfreeimage-dev libatlas3-base libfftw3-dev cmake ocl-icd-libopencl1

- name: Download and install ArrayFire
run: |
wget -q "$AF_URL" -O "$AF_INSTALLER"
chmod +x "$AF_INSTALLER"
sudo "./$AF_INSTALLER" --exclude-subdir --prefix=/opt
sudo ldconfig

- name: Update cabal package list
run: cabal update

- name: Build
run: nix-shell -p ghc -p cabal-install --keep LD_LIBRARY_PATH --run 'cabal build'
env:
LD_LIBRARY_PATH: "/opt/arrayfire/lib:/opt/arrayfire/lib64"
Loading