Add CI workflow #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |
| AF_PREFIX: "/opt/arrayfire" | |
| 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="$AF_PREFIX" | |
| echo /opt/arrayfire/lib64 > /etc/ld.so.conf.d/arrayfire.conf | |
| 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" |