Skip to content

Commit 6dacb8c

Browse files
committed
WIP: Move macOS builds from Azure Pipelines to GitHub Actions
This simplifies the CI setup substantially.
1 parent a75ad59 commit 6dacb8c

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test:
10+
test-linux:
1111
runs-on: ubuntu-24.04
1212
steps:
1313
- uses: actions/checkout@v3
@@ -76,3 +76,41 @@ jobs:
7676
# `test_translator.py` does not rebuild,
7777
# so changing `RUSTFLAGS` will not trigger a full rebuild.
7878
./scripts/test_translator.py tests/
79+
80+
test-mac:
81+
runs-on: macos-14
82+
steps:
83+
- uses: actions/checkout@v3
84+
- run: rustup component add rustfmt rustc-dev
85+
# Needs adding to the safelist for c2rust GitHub Actions
86+
#- uses: Swatinem/rust-cache@v2
87+
- name: Provision macOS
88+
run: |
89+
./scripts/provision_mac.sh
90+
# speeds up provisioning
91+
export HOMEBREW_NO_AUTO_UPDATE=1
92+
# prepare environment for the following steps
93+
source $HOME/.cargo/env
94+
# print some useful info to help troubleshoot
95+
brew info llvm@17
96+
which python3
97+
/usr/bin/env python3 -c "import sys; print(sys.path)"
98+
99+
- name: cargo build --release
100+
run: |
101+
export LLVM_CONFIG_PATH=$(brew --prefix llvm@17)/bin/llvm-config
102+
export RUSTFLAGS="-D warnings"
103+
export RUSTDOCFLAGS="-D warnings"
104+
# Don't build with `--all-features` (see analogous step for Linux).
105+
cargo build --release
106+
107+
- name: cargo test --release --workspace
108+
run: |
109+
export RUSTFLAGS="-D warnings"
110+
export RUSTDOCFLAGS="-D warnings"
111+
cargo test --release --workspace
112+
113+
- name: Test translator
114+
run: |
115+
# `RUSTFLAGS` not set (see analogous step for Linux).
116+
./scripts/test_translator.py tests/

scripts/provision_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export HOMEBREW_NO_AUTO_UPDATE=1
2323
brew install -q python cmake ninja gpg llvm@17 bash
2424

2525
# Python 3 packages
26-
python3 -m pip install --user --upgrade pip
27-
python3 -m pip install --user -r "$SCRIPT_DIR/requirements.txt"
26+
python3 -m pip install --break-system-packages --user --upgrade pip
27+
python3 -m pip install --break-system-packages --user -r "$SCRIPT_DIR/requirements.txt"
2828

2929
# Rust and dependencies
3030
RUST_TOOLCHAIN_FILE="$SCRIPT_DIR/../rust-toolchain.toml"

0 commit comments

Comments
 (0)