Initial commit #7
This file contains 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: build | |
on: push | |
jobs: | |
build: | |
runs-on: >- | |
${{ | |
(matrix.os == 'mac' && matrix.arch == 'arm64') && | |
'macos-14' || | |
(fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.os]) | |
}} | |
continue-on-error: false | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [linux, mac] | |
arch: [arm64, x64] | |
steps: | |
- name: Install linux dependencies | |
if: matrix.os == 'linux' && matrix.arch == runner.arch | |
run: sudo apt-get install -y libblas-dev liblapack-dev liblapacke-dev | |
- name: Install mac dependencies | |
if: matrix.os == 'mac' && matrix.arch == 'x64' | |
run: brew install openblas | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v2 | |
id: cpu-cores | |
- name: Build | |
if: matrix.os != 'linux' || matrix.arch == runner.arch | |
run: yarn && yarn build -p ${{ steps.cpu-cores.outputs.count }} | |
- name: Set up QEMU | |
if: matrix.os == 'linux' && matrix.arch != runner.arch | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platform: matrix.arch | |
- name: Enable multi-arch containers in QEMU | |
if: matrix.os == 'linux' && matrix.arch != runner.arch | |
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- name: Build (in docker) | |
if: matrix.os == 'linux' && matrix.arch != runner.arch | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: animcogn/face_recognition | |
options: --platform=linux/${{ matrix.arch }} -v ${{ github.workspace }}:/build -w /build | |
run: yarn && yarn build -p ${{ steps.cpu-cores.outputs.count }} |