Skip to content

Commit 4a59249

Browse files
committed
ci: Dump deprecated Ubuntu 20.04 runner
Ubuntu 20.04 runners for GitHub Actions have been retired. Let's remove them from the build matrix, to avoid failures in our CI. We want to add Ubuntu 24.04 instead, but need to finalise #179 for that. Link: https://github.blog/changelog/2025-01-15-github-actions-ubuntu-20-runner-image-brownout-dates-and-other-breaking-changes/ Signed-off-by: Quentin Monnet <[email protected]>
1 parent 63c1a37 commit 4a59249

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

.github/workflows/build.yaml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
os: [ubuntu-20.04, ubuntu-22.04]
24+
os: [ubuntu-22.04, macos-14]
2525
runs-on: ${{ matrix.os }}
2626
env:
2727
FEATURES: .llvm and .skeletons
@@ -32,13 +32,8 @@ jobs:
3232
with:
3333
submodules: true
3434

35-
- name: Use clang-12 and not clang-11 for older Ubuntu
36-
if: matrix.os == 'ubuntu-20.04'
37-
run: |
38-
sudo apt-get remove -y clang-11 llvm-11
39-
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 50
40-
41-
- name: Install dependencies
35+
- name: Install dependencies (Linux)
36+
if: startsWith(matrix.os, 'ubuntu')
4237
run: |
4338
sudo apt-get update
4439
sudo apt-get install -y \
@@ -51,6 +46,33 @@ jobs:
5146
--slave /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-"${CLANG_VERSION}"
5247
echo "CLANG_VERSION=${CLANG_VERSION}" >> "${GITHUB_ENV}"
5348
49+
- name: Install dependencies (macOS)
50+
if: startsWith(matrix.os, 'macos')
51+
run: |
52+
brew update
53+
brew install \
54+
binutils \
55+
libelf \
56+
docutils \
57+
jq \
58+
llvm
59+
60+
# Set up LLVM paths and aliases
61+
LLVM_PATH="$(brew --prefix llvm)"
62+
CLANG_VERSION="$(echo '__clang_major__' | ${LLVM_PATH}/bin/clang -E - | tail -n 1)"
63+
64+
# Create symlinks for LLVM tools in a directory that's in PATH
65+
mkdir -p "${HOME}/bin"
66+
ln -sf "${LLVM_PATH}/bin/llvm-config" "${HOME}/bin/llvm-config"
67+
ln -sf "${LLVM_PATH}/bin/llvm-ar" "${HOME}/bin/llvm-ar"
68+
ln -sf "${LLVM_PATH}/bin/llvm-strip" "${HOME}/bin/llvm-strip"
69+
ln -sf "${LLVM_PATH}/bin/clang" "${HOME}/bin/clang"
70+
71+
# Add to PATH
72+
echo "${HOME}/bin" >> $GITHUB_PATH
73+
echo "CLANG_VERSION=${CLANG_VERSION}" >> "${GITHUB_ENV}"
74+
echo "LLVM_PATH=${LLVM_PATH}" >> "${GITHUB_ENV}"
75+
5476
- name: Build bpftool (default LLVM disassembler)
5577
run: |
5678
make -j -C src V=1
@@ -68,7 +90,8 @@ jobs:
6890
tee /dev/stderr | \
6991
jq --exit-status ".features | ${FEATURES}"
7092
71-
- name: Build bpftool, with fallback to libbfd disassembler
93+
- name: Build bpftool, with fallback to libbfd disassembler (Linux)
94+
if: startsWith(matrix.os, 'ubuntu')
7295
run: |
7396
sudo apt-get remove -y llvm-"${CLANG_VERSION}"-dev
7497
make -C src clean
@@ -78,7 +101,8 @@ jobs:
78101
tee /dev/stderr | \
79102
jq --exit-status ".features | .libbfd and (.llvm | not)"
80103
81-
- name: Build bpftool, with libbfd, static build
104+
- name: Build bpftool, with libbfd, static build (Linux)
105+
if: startsWith(matrix.os, 'ubuntu')
82106
run: |
83107
make -C src clean
84108
EXTRA_CFLAGS=--static make -j -C src V=1

0 commit comments

Comments
 (0)