ci: bump docker/setup-qemu-action from 3.6.0 to 3.7.0 #381
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/build.yaml' | |
| - 'docs/**' | |
| - 'include/**' | |
| - 'libbpf/**' | |
| - 'src/**' | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-24.04] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| FEATURES: .llvm and .skeletons | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| submodules: true | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libbfd-dev libcap-dev libelf-dev libiberty-dev libssl-dev \ | |
| python3-docutils | |
| # clang/LLVM are already installed, but we're missing some aliases. | |
| CLANG_VERSION="$(echo '__clang_major__' | clang -E - | tail -n 1)" | |
| sudo update-alternatives \ | |
| --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-"${CLANG_VERSION}" 50 \ | |
| --slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-"${CLANG_VERSION}" \ | |
| --slave /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-"${CLANG_VERSION}" | |
| echo "CLANG_VERSION=${CLANG_VERSION}" >> "${GITHUB_ENV}" | |
| - name: Build bpftool (default LLVM disassembler) | |
| run: | | |
| make -j -C src V=1 | |
| ./src/bpftool 2>&1 | grep -q Usage | |
| ./src/bpftool -p version | \ | |
| tee /dev/stderr | \ | |
| jq --exit-status ".features | ${FEATURES}" | |
| - name: Build bpftool, with clang | |
| run: | | |
| make -C src clean | |
| LLVM=1 make -j -C src V=1 | |
| ./src/bpftool 2>&1 | grep -q Usage | |
| ./src/bpftool -p version | \ | |
| tee /dev/stderr | \ | |
| jq --exit-status ".features | ${FEATURES}" | |
| - name: Build bpftool, with fallback to libbfd disassembler | |
| run: | | |
| sudo apt-get remove -y llvm-"${CLANG_VERSION}"-dev | |
| make -C src clean | |
| make -j -C src V=1 | |
| ./src/bpftool 2>&1 | grep -q Usage | |
| ./src/bpftool -p version | \ | |
| tee /dev/stderr | \ | |
| jq --exit-status ".features | .libbfd and (.llvm | not)" | |
| - name: Build bpftool, with libbfd, static build | |
| run: | | |
| make -C src clean | |
| if [[ "${{ matrix.os }}" == "ubuntu-24.04" ]]; then | |
| # FIXME - See #73 | |
| echo "... building bootstrap bpftool" | |
| EXTRA_LDFLAGS=-static make -j -C src V=1 \ | |
| LIBS="./bootstrap/libbpf/libbpf.a -lelf -lz -lcrypto -lzstd -lcap -lbfd -ldl -liberty -lz -lzstd -lsframe -lopcodes" \ | |
| bootstrap | |
| echo "... building main bpftool binary" | |
| EXTRA_LDFLAGS=-static make -j -C src V=1 \ | |
| LIBS="./libbpf/libbpf.a -lelf -lz -lcrypto -lzstd -lcap -lbfd -ldl -liberty -lz -lzstd -lsframe -lopcodes" | |
| else | |
| EXTRA_LDFLAGS=-static make -j -C src V=1 | |
| fi | |
| ./src/bpftool 2>&1 | grep -q Usage | |
| ./src/bpftool -p version | \ | |
| tee /dev/stderr | \ | |
| jq --exit-status ".features | .libbfd and (.llvm | not)" | |
| ldd ./src/bpftool 2>&1 | \ | |
| tee /dev/stderr | \ | |
| grep -q 'not a dynamic executable' | |
| - name: Build bpftool's documentation | |
| run: | | |
| make -j -C docs | |
| grep -q '.TH "\?BPFTOOL"\? 8' ./docs/bpftool.8 |