|
21 | 21 | strategy: |
22 | 22 | fail-fast: false |
23 | 23 | matrix: |
24 | | - os: [ubuntu-20.04, ubuntu-22.04] |
| 24 | + os: [ubuntu-22.04, macos-14] |
25 | 25 | runs-on: ${{ matrix.os }} |
26 | 26 | env: |
27 | 27 | FEATURES: .llvm and .skeletons |
|
32 | 32 | with: |
33 | 33 | submodules: true |
34 | 34 |
|
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') |
42 | 37 | run: | |
43 | 38 | sudo apt-get update |
44 | 39 | sudo apt-get install -y \ |
|
51 | 46 | --slave /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-"${CLANG_VERSION}" |
52 | 47 | echo "CLANG_VERSION=${CLANG_VERSION}" >> "${GITHUB_ENV}" |
53 | 48 |
|
| 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 | +
|
54 | 76 | - name: Build bpftool (default LLVM disassembler) |
55 | 77 | run: | |
56 | 78 | make -j -C src V=1 |
|
68 | 90 | tee /dev/stderr | \ |
69 | 91 | jq --exit-status ".features | ${FEATURES}" |
70 | 92 |
|
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') |
72 | 95 | run: | |
73 | 96 | sudo apt-get remove -y llvm-"${CLANG_VERSION}"-dev |
74 | 97 | make -C src clean |
|
78 | 101 | tee /dev/stderr | \ |
79 | 102 | jq --exit-status ".features | .libbfd and (.llvm | not)" |
80 | 103 |
|
81 | | - - name: Build bpftool, with libbfd, static build |
| 104 | + - name: Build bpftool, with libbfd, static build (Linux) |
| 105 | + if: startsWith(matrix.os, 'ubuntu') |
82 | 106 | run: | |
83 | 107 | make -C src clean |
84 | 108 | EXTRA_CFLAGS=--static make -j -C src V=1 |
|
0 commit comments