Skip to content

Commit

Permalink
build: create a dedicated CI workflow for forks
Browse files Browse the repository at this point in the history
Forked bpfilter repositories can't use the project's runner, and the
GitHub-provided runners use an old kernel, preventing unit tests from
being run.

This change disable the project's CI workflows building bpfilter on the
self-hosted runners and add a new workflow, specific to forks, to build
bpfilter and run a few checks.

Signed-off-by: Quentin Deslandes <[email protected]>
  • Loading branch information
qdeslandes committed Feb 10, 2024
1 parent 53ab9f8 commit 82f4975
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permissions:

jobs:
full:
if: github.repository == 'facebook/bpfilter'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
run: make -C $GITHUB_WORKSPACE/build doc

build:
if: github.repository == 'facebook/bpfilter'
strategy:
fail-fast: false
matrix:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/fork.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Fork-specific CI

on:
push:
branches:
- "**"

permissions:
checks: write
pull-requests: write

jobs:
full:
if: github.repository != 'facebook/bpfilter'
strategy:
fail-fast: false
matrix:
# This forces GitHub to print "fedora:39, x64" in the job name.
system: ["fedora:39"]
arch: ["X64"]
mode: ["release", "debug"]
container: "${{ matrix.system }}"
runs-on: ["ubuntu-latest"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies (Fedora)
run: |
sudo dnf --disablerepo=* --enablerepo=fedora,updates --setopt=install_weak_deps=False -y install \
clang-tools-extra \
cmake \
libcmocka-devel \
doxygen \
lcov \
libasan \
libbpf-devel \
libubsan \
python3-breathe \
python3-furo \
python3-sphinx \
pkgconf
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=${{ matrix.mode }}
- name: Build
run: make -C $GITHUB_WORKSPACE/build
# Skip unit tests, the GitHub-hosted runners' kernel is too old.
# Skip coverage as unit tests are not run.
- name: Check style
run: make -C $GITHUB_WORKSPACE/build checkstyle
- name: Generate documentation
run: make -C $GITHUB_WORKSPACE/build doc
1 change: 1 addition & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ concurrency:

jobs:
deploy:
if: github.repository == 'facebook/bpfilter'
container: "fedora:39"
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 82f4975

Please sign in to comment.