Skip to content

Commit

Permalink
ci: Run BPF lints on workflow definition changes
Browse files Browse the repository at this point in the history
[ upstream commit 071c2af ]

In the past, we have merged automated updates to the coccicheck image
version (for example, [0]) without realising they may break the
workflow, because the workflow wouldn't run on the PR, which contained
no BPF-related changes.

Let's make the workflow run when its definition file is updated, to make
sure we can catch similar issues in the future.

[0] #27947

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Donia <donia.cld@isovalent.com>
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
  • Loading branch information
qmonnet authored and giorio94 committed Sep 26, 2023
1 parent dd56b3c commit b8c03dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/lint-bpf-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
bpf-tree: ${{ steps.changes.outputs.bpf-tree }}
coccinelle: ${{ steps.changes.outputs.coccinelle }}
bpf-tests-runner: ${{ steps.changes.outputs.bpf-tests-runner }}
workflow-description: ${{ steps.changes.outputs.workflow-description }}
steps:
- name: Checkout code
if: ${{ !github.event.pull_request }}
Expand All @@ -42,6 +43,8 @@ jobs:
- 'contrib/coccinelle/**'
bpf-tests-runner:
- 'test/bpf_tests/**'
workflow-description:
- '.github/workflows/lint-bpf-checks.yaml'
checkpatch:
name: Check Patch
Expand All @@ -59,7 +62,7 @@ jobs:
# Runs only if code under bpf/ or contrib/coccinnelle/ is changed.
coccicheck:
needs: check_changes
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' || needs.check_changes.outputs.coccinelle == 'true' }}
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' || needs.check_changes.outputs.coccinelle == 'true' || needs.check_changes.outputs.workflow-description == 'true' }}
name: Run coccicheck
runs-on: ubuntu-latest
steps:
Expand All @@ -85,7 +88,7 @@ jobs:
# Runs only if code under bpf/ is changed.
build_all:
needs: [check_changes, set_clang_dir]
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' }}
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' || needs.check_changes.outputs.workflow-description == 'true' }}
name: Build Datapath
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:
bpf_tests:
needs: [check_changes, set_clang_dir]
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' || needs.check_changes.outputs.bpf-tests-runner == 'true' }}
if: ${{ needs.check_changes.outputs.bpf-tree == 'true' || needs.check_changes.outputs.bpf-tests-runner == 'true' || needs.check_changes.outputs.workflow-description == 'true' }}
name: BPF unit/integration Tests
runs-on: ubuntu-22.04
steps:
Expand Down

0 comments on commit b8c03dd

Please sign in to comment.