Skip to content

Commit 281a460

Browse files
authored
Automate mac aarch64 builds (#12)
1 parent 923fff3 commit 281a460

File tree

1 file changed

+40
-45
lines changed

1 file changed

+40
-45
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
- "**"
5+
- "wasix*"
66
pull_request:
77
workflow_call:
88
jobs:
@@ -12,7 +12,7 @@ jobs:
1212
- name: show git config
1313
run: |
1414
env
15-
cat ~/.config/git/config || true
15+
cat ~/.config/git/config || true
1616
cat ~/.gitconfig || true
1717
ls -lha ./wasix-libc || true
1818
@@ -69,17 +69,23 @@ jobs:
6969
needs: build-libc
7070
strategy:
7171
matrix:
72-
os: [ubuntu-latest-8-cores, macos-12, windows-latest-8-cores]
73-
arch: [x86, aarch64]
74-
exclude:
75-
- os: windows-latest-8-cores
76-
arch: aarch64
77-
- os: windows-latest-8-cores
78-
arch: aarch64
79-
- os: ubuntu-latest-8-cores
80-
arch: aarch64
81-
- os: ubuntu-latest-8-cores
72+
include:
73+
- name: Windows (x86)
74+
os: windows-latest-8-cores
75+
arch: x86
76+
77+
- name: Ubuntu (x86)
78+
os: ubuntu-latest-8-cores
79+
arch: x86
80+
81+
- name: Mac (x86)
82+
os: macos-12-large
83+
arch: x86
84+
85+
- name: Mac (aarch64)
86+
os: macos-13-xlarge
8287
arch: aarch64
88+
8389
runs-on: ${{ matrix.os }}
8490
steps:
8591
- name: Install Rust
@@ -189,40 +195,29 @@ jobs:
189195
190196
# Mac - aarch64
191197

192-
# Not running this on GitHub Actions yet, because the underlying runners use x86_64 and not aarch64.
193-
# This results in a cross-compile, which results in an erroneous build.
194-
195-
# TODO: Come back to this and enable it once GitHub Actions supports aarch64 runners.
196-
197-
# - name: Build (Mac Os, aarch64)
198-
# shell: bash
199-
# if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64'
200-
# env:
201-
# WASIX_NO_UPDATE_REPOS: "1"
202-
# GITHUB_ACTIONS: "false"
203-
# WASIX_COMPONENTS: rust
204-
# WASIX_RUST_HOST: aarch64-apple-darwin
205-
# run: |
206-
# cd cargo-wasix
207-
# # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it.
208-
# # (see bootstrap config.rs)
209-
# GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain
210-
211-
# - name: Copy wasm* builds from x86_64-apple-darwin to aarch64-apple-darwin
212-
# shell: bash
213-
# if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64'
214-
# run: |
215-
# cp -r wasix-rust/build/x86_64-apple-darwin/stage2/lib/rustlib/wasm* wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib
198+
- name: Build (Mac Os, aarch64)
199+
shell: bash
200+
if: contains(matrix.os, 'macos') && matrix.arch == 'aarch64'
201+
env:
202+
WASIX_NO_UPDATE_REPOS: "1"
203+
GITHUB_ACTIONS: "false"
204+
WASIX_COMPONENTS: rust
205+
WASIX_RUST_HOST: aarch64-apple-darwin
206+
run: |
207+
cd cargo-wasix
208+
# NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it.
209+
# (see bootstrap config.rs)
210+
GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain
216211
217-
# - name: Archive build output (Mac OS - aarch64)
218-
# uses: actions/upload-artifact@v3
219-
# if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64'
220-
# with:
221-
# name: rust-toolchain-aarch64-apple-darwin
222-
# path: |
223-
# wasix-rust/build/aarch64-apple-darwin/stage2
224-
# !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src
225-
# !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src
212+
- name: Archive build output (Mac OS - aarch64)
213+
uses: actions/upload-artifact@v3
214+
if: contains(matrix.os, 'macos') && matrix.arch == 'aarch64'
215+
with:
216+
name: rust-toolchain-aarch64-apple-darwin
217+
path: |
218+
wasix-rust/build/aarch64-apple-darwin/stage2
219+
!wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src
220+
!wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src
226221
227222
# Windows
228223

0 commit comments

Comments
 (0)