Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/scripts/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class BuildConfig:
run_veristat: bool = False
parallel_tests: bool = False
build_release: bool = False
is_netdev: bool = False

@property
def runs_on(self) -> List[str]:
Expand Down Expand Up @@ -184,7 +185,7 @@ def tests(self) -> Dict[str, Any]:
if self.llvm_version >= 18:
tests_list.append("test_progs_cpuv4")

if self.arch in [Arch.X86_64, Arch.AARCH64]:
if self.arch in [Arch.X86_64, Arch.AARCH64] and not self.is_netdev:
tests_list.append("sched_ext")

# Don't run GCC BPF runner, because too many tests are failing
Expand All @@ -207,6 +208,7 @@ def to_dict(self) -> Dict[str, Any]:
"run_veristat": self.run_veristat,
"parallel_tests": self.parallel_tests,
"build_release": self.build_release,
"is_netdev": self.is_netdev,
"runs_on": self.runs_on,
"tests": self.tests,
"build_runs_on": self.build_runs_on,
Expand Down Expand Up @@ -270,6 +272,17 @@ def generate_test_config(test: str) -> Dict[str, Union[str, int]]:
if not is_managed_repo():
matrix = [config for config in matrix if config.arch == Arch.X86_64]

# Detect netdev PRs: head repo is linux-netdev/testing-bpf-ci and branch is to-test
pr_head_repo = os.environ.get("PR_HEAD_REPO", "")
head_ref = os.environ.get("GITHUB_HEAD_REF", "")
is_netdev = pr_head_repo == "linux-netdev/testing-bpf-ci" and head_ref == "to-test"
if is_netdev:
print("Netdev PR detected, disabling BPF-specific jobs")
for config in matrix:
config.run_veristat = False
config.build_release = False
config.is_netdev = True

json_matrix = json.dumps({"include": [config.to_dict() for config in matrix]})
print(json.dumps(json.loads(json_matrix), indent=4))
set_output("build_matrix", json_matrix)
7 changes: 6 additions & 1 deletion .github/workflows/kernel-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ on:
type: boolean
description: Build selftests with -O2 optimization in addition to non-optimized build.
default: false
is_netdev:
required: true
type: boolean
description: Whether this is a netdev PR. When true, BPF-specific jobs like GCC BPF are skipped.
default: false
secrets:
AWS_ROLE_ARN:
required: true
Expand Down Expand Up @@ -179,7 +184,7 @@ jobs:

gcc-bpf:
name: 'GCC BPF'
if: ${{ inputs.arch == 'x86_64' }}
if: ${{ inputs.arch == 'x86_64' && !inputs.is_netdev }}
uses: ./.github/workflows/gcc-bpf.yml
needs: [build]
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- id: set-matrix-impl
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_READ_RUNNERS }}
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
run: |
python3 .github/scripts/matrix.py

Expand Down Expand Up @@ -64,5 +65,6 @@ jobs:
# Download sources
download_sources: ${{ github.repository == 'kernel-patches/vmtest' }}
build_release: ${{ matrix.build_release }}
is_netdev: ${{ matrix.is_netdev }}
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
Loading