Add CI workflow #8
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: "/usr/local" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixpkgs-unstable | |
| - run: nix-channel --update | |
| - uses: actions/checkout@v4 | |
| - name: Nix channel update | |
| run: nix-channel --update | |
| - name: Cabal install | |
| run: nix-env -iA pkgs.cabal-install -f . | |
| - 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" | |
| - name: Update cabal package list | |
| run: cabal update | |
| - name: Build | |
| run: nix-shell -p ghc -p cabal-install --run 'cabal build' | |
| env: | |
| PATH: "/usr/local/bin:${{ env.PATH }}" | |
| LD_LIBRARY_PATH: "/usr/local/lib" |