Skip to content

Add darwin build and dev support. #58

Add darwin build and dev support.

Add darwin build and dev support. #58

Workflow file for this run

name: ArrayFire CI
on:
push:
branches:
- master
pull_request:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest] # Add macOS to the matrix
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install ArrayFire (macOS)
if: runner.os == 'macOS'
run: |
set -euo pipefail
brew install arrayfire
# The cabal file's OSX default paths are hardcoded to /opt/arrayfire;
# point them at the Homebrew install so the build finds the headers,
# libs, and rpath.
sudo ln -sfn "$(brew --prefix arrayfire)" /opt/arrayfire
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Nix channel --update
run: nix-channel --update
- name: Cabal update
run: nix develop --command bash -c 'cabal update'
- name: Build and run tests
run: nix develop --command bash -c 'cabal install hspec-discover && cabal test'