Skip to content

Commit

Permalink
ci: Build with native linux arm64 runner
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Jan 18, 2025
1 parent 08966be commit 47e07c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ jobs:
build:
runs-on: >-
${{
(matrix.os == 'mac' && matrix.arch == 'arm64') &&
((matrix.os == 'linux' && matrix.arch == 'arm64') &&
'ubuntu-22.04-arm' ||
((matrix.os == 'mac' && matrix.arch == 'arm64') &&
'macos-15' ||
(fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.os])
(fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.os])))
}}
continue-on-error: false

Expand Down Expand Up @@ -39,30 +41,9 @@ jobs:
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Build (native)
if: matrix.os != 'linux' || matrix.arch == runner.arch
- name: Build
run: yarn && yarn build -p ${{ steps.cpu-cores.outputs.count }} && yarn test

- name: Set up QEMU
if: matrix.os == 'linux' && matrix.arch != runner.arch
uses: docker/setup-qemu-action@v3
with:
platforms: 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 (docker)
if: matrix.os == 'linux' && matrix.arch != runner.arch
uses: addnab/docker-run-action@v3
with:
image: zcbenz/node-mlx:main
options: --platform=linux/${{ matrix.arch }} -v ${{ github.workspace }}:/build -w /build
run: |
export CI=true
yarn && yarn build -p ${{ steps.cpu-cores.outputs.count }} && yarn test
- name: Prepare .node file
run: cp build/Release/mlx.node mlx-${{ matrix.os }}-${{ matrix.arch }}.node

Expand Down
2 changes: 1 addition & 1 deletion deps/mlx
Submodule mlx updated 1 files
+1 −1 mlx/ops.cpp

0 comments on commit 47e07c9

Please sign in to comment.