Skip to content

Commit e6560e7

Browse files
committed
ci: Run on macOS (ARM, Intel)
1 parent 5b961ee commit e6560e7

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
llvm: 21
6969
exclude-features: llvm-19,llvm-20,rust-llvm-19,rust-llvm-20
7070
platform:
71+
- os: macos-latest
72+
- os: macos-15-intel
7173
- os: ubuntu-22.04
7274
- os: ubuntu-22.04-arm
7375
llvm-from:
@@ -108,23 +110,24 @@ jobs:
108110
run: cargo install btfdump
109111

110112
- name: Install prerequisites
111-
if: runner.arch == 'X86'
113+
if: runner.os == 'Linux' && runner.arch == 'X86'
112114
# gcc-multilib provides at least <asm/types.h> which is referenced by libbpf.
113115
run: |
114116
set -euxo pipefail
115117
sudo apt update
116118
sudo apt -y install gcc-multilib
117119
118120
- name: Add clang 15 to PATH
121+
if: runner.os == 'Linux'
119122
# ubuntu-22.04 comes with clang 13-15[0]; support for signed and 64bit
120123
# enum values was added in clang 15[1] which isn't in `$PATH`.
121124
#
122125
# [0] https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
123126
# [1] https://github.com/llvm/llvm-project/commit/dc1c43d
124127
run: echo /usr/lib/llvm-15/bin >> $GITHUB_PATH
125128

126-
- name: Install LLVM
127-
if: matrix.llvm-from == 'packages'
129+
- name: Install LLVM (Linux, packages)
130+
if: matrix.llvm-from == 'packages' && runner.os == 'Linux'
128131
run: |
129132
set -euxo pipefail
130133
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
@@ -134,6 +137,14 @@ jobs:
134137
sudo apt -y install llvm-${{ matrix.toolchain.llvm }}-dev
135138
echo /usr/lib/llvm-${{ matrix.toolchain.llvm }}/bin >> $GITHUB_PATH
136139
140+
- name: Install LLVM (macOS, packages)
141+
if: matrix.llvm-from == 'packages' && runner.os == 'macOS'
142+
run: |
143+
set -euxo pipefail
144+
brew install llvm@${{ matrix.toolchain.llvm }}
145+
echo $(brew --prefix llvm@${{ matrix.toolchain.llvm }})/bin >> $GITHUB_PATH
146+
echo "DYLD_LIBRARY_PATH=$(brew --prefix llvm@${{ matrix.toolchain.llvm }})/lib" >> $GITHUB_ENV
147+
137148
- name: Restore LLVM
138149
if: matrix.llvm-from == 'source'
139150
uses: actions/cache/restore@v4
@@ -212,18 +223,18 @@ jobs:
212223
--features ${{ env.LLVM_FEATURES }}
213224
214225
- uses: actions/checkout@v6
215-
if: matrix.toolchain.rust == 'nightly'
226+
if: runner.os == 'Linux' && matrix.toolchain.rust == 'nightly'
216227
with:
217228
repository: aya-rs/aya
218229
path: aya
219230
submodules: recursive
220231

221232
- name: Install
222-
if: matrix.toolchain.rust == 'nightly'
233+
if: runner.os == 'Linux' && matrix.toolchain.rust == 'nightly'
223234
run: cargo install --path . --no-default-features --features ${{ env.LLVM_FEATURES }}
224235

225236
- name: Run aya integration tests
226-
if: matrix.toolchain.rust == 'nightly'
237+
if: runner.os == 'Linux' && matrix.toolchain.rust == 'nightly'
227238
working-directory: aya
228239
run: cargo xtask integration-test local
229240

0 commit comments

Comments
 (0)