container: merge grout and FRR into a single image #2587
Workflow file for this run
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
| # SPDX-License-Identifier: BSD-3-Clause | |
| # Copyright (c) 2023 Robin Jarry | |
| --- | |
| name: Check | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_call: | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-tests: | |
| if: ${{ github.actor != 'grout-bot' }} | |
| permissions: | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| conf: | |
| - compiler: gcc-13 | |
| dpdk: '25.11' | |
| frr: '10.5' | |
| rebase: true | |
| - compiler: gcc-14 | |
| dpdk: '25.11' | |
| frr: '10.5' | |
| asan: true | |
| debug: true | |
| - compiler: gcc-14 | |
| frr: '10.5' | |
| dpdk: '25.11' | |
| arch: aarch64 | |
| - compiler: gcc-14 | |
| dpdk: '25.11' | |
| frr: '10.6' | |
| - compiler: gcc-14 | |
| dpdk: '25.11-head' | |
| frr: '10.5' | |
| - compiler: gcc-14 | |
| dpdk: 'main' | |
| frr: '10.5' | |
| allow_fail: true | |
| - compiler: gcc-14 | |
| dpdk: '25.11' | |
| frr: 'master' | |
| allow_fail: true | |
| - compiler: clang-16 | |
| dpdk: '25.11' | |
| frr: '10.5' | |
| - compiler: clang-18 | |
| dpdk: '25.11' | |
| frr: '10.5' | |
| name: build-and-tests (${{ matrix.conf.arch || 'x86_64' }}, ${{ matrix.conf.compiler }}, DPDK ${{ matrix.conf.dpdk }}, FRR ${{ matrix.conf.frr }}) | |
| runs-on: ubuntu-24.04${{ matrix.conf.arch == 'aarch64' && '-arm' || '' }} | |
| continue-on-error: ${{ matrix.conf.allow_fail || false }} | |
| env: | |
| SANITIZE: ${{ case(matrix.conf.asan || false, 'address', 'none') }} | |
| BUILDTYPE: ${{ case(matrix.conf.debug || false, 'debug', 'debugoptimized') }} | |
| DEBIAN_FRONTEND: noninteractive | |
| NEEDRESTART_MODE: l | |
| CC: ccache ${{ matrix.conf.compiler }} | |
| FRR: ${{ matrix.conf.frr }} | |
| DPDK: ${{ matrix.conf.dpdk }} | |
| DPDK_CPU: generic | |
| steps: | |
| - name: install system dependencies | |
| run: | | |
| set -xe | |
| # grout dependencies | |
| sudo apt-get update -qy | |
| sudo apt-get install -qy --no-install-recommends \ | |
| make gcc gdb ccache ninja-build meson git scdoc \ | |
| libibverbs-dev libasan8 libcmocka-dev libedit-dev libarchive-dev \ | |
| libevent-dev libmnl-dev libnuma-dev python3-pyelftools \ | |
| socat tcpdump traceroute graphviz iproute2 iputils-ping ndisc6 jq \ | |
| dnsmasq systemd-coredump abigail-tools \ | |
| "linux-modules-extra-$(uname -r)" | |
| # FRR dependencies | |
| sudo mkdir -p /etc/apt/keyrings | |
| sudo curl -s -o /etc/apt/keyrings/frrouting.gpg https://deb.frrouting.org/frr/keys.gpg | |
| echo "deb [signed-by=/etc/apt/keyrings/frrouting.gpg] https://deb.frrouting.org/frr \ | |
| $(lsb_release -s -c) frr-stable" | sudo tee /etc/apt/sources.list.d/frr.list > /dev/null | |
| sudo apt-get update -qy | |
| sudo apt-get install -qy --no-install-recommends \ | |
| libjson-c-dev libelf-dev libprotobuf-c-dev protobuf-c-compiler \ | |
| libreadline-dev libcap-dev librtr-dev libyang2-dev libyang2-tools | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 # force fetch all history | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - run: git config --global --add safe.directory $PWD | |
| - run: git fetch --force origin 'refs/tags/v*:refs/tags/v*' | |
| - run: echo "CCACHE_DIR=$(ccache -k cache_dir)" >> $GITHUB_ENV | |
| - uses: actions/cache/restore@v5 | |
| id: cache | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: ccache-${{ matrix.conf.arch || 'x86_64' }}-${{ matrix.conf.compiler }} | |
| - run: ccache -z | |
| - run: git rebase -x .github/workflows/check.sh "HEAD~${{ github.event.pull_request.commits }}" | |
| if: ${{ matrix.conf.rebase && github.event.pull_request.commits }} | |
| - run: .github/workflows/check.sh | |
| if: ${{ ! matrix.conf.rebase || ! github.event.pull_request.commits }} | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: smoke-logs-${{ matrix.conf.arch || 'x86_64' }}-${{ matrix.conf.compiler }}-dpdk-${{ matrix.conf.dpdk }}-frr-${{ matrix.conf.frr }} | |
| path: build/smoke/ | |
| retention-days: 10 | |
| if: always() | |
| - run: ccache -sv | |
| - name: delete old cache | |
| if: ${{ ! github.event.pull_request.commits }} | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| try { | |
| await github.rest.actions.deleteActionsCacheByKey({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| key: "${{ steps.cache.outputs.cache-primary-key }}" | |
| }); | |
| } catch (error) { | |
| if (error.status !== 404) throw error; | |
| } | |
| - uses: actions/cache/save@v5 | |
| if: ${{ ! github.event.pull_request.commits }} | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: ${{ steps.cache.outputs.cache-primary-key }} | |
| lint: | |
| if: ${{ github.actor != 'grout-bot' }} | |
| runs-on: ubuntu-24.04 | |
| container: fedora:latest | |
| steps: | |
| - run: dnf install -y gawk make clang-tools-extra git jq curl codespell | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 # force fetch all history | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - run: git config --global --add safe.directory $PWD | |
| - run: git fetch --force origin 'refs/tags/v*:refs/tags/v*' | |
| - run: git rebase -x ".github/workflows/check.sh lint" "HEAD~${{ github.event.pull_request.commits }}" | |
| if: ${{ github.event.pull_request.commits }} | |
| - run: .github/workflows/check.sh lint | |
| if: ${{ ! github.event.pull_request.commits }} | |
| commits: | |
| runs-on: ubuntu-24.04 | |
| if: ${{ github.event.pull_request.commits }} | |
| container: fedora:latest | |
| env: | |
| REVISION_RANGE: "HEAD~${{ github.event.pull_request.commits }}.." | |
| steps: | |
| - run: dnf install -y make git jq curl codespell | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 # force fetch all history | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - run: git config --global --add safe.directory $PWD | |
| - run: git fetch --force origin 'refs/tags/v*:refs/tags/v*' | |
| - run: make check-patches |