Skip to content

Commit

Permalink
.github: skip ci-l4lb-* tests if files haven't been modified
Browse files Browse the repository at this point in the history
In certain cases where none of the following directories have changes:
`pkg/**`, `daemon/**`, `bpf/**`, `test/l4lb/**`, `images/**`, the `ci-l4lb-*`
tests can now be marked as successful. Previously, this was not possible
because the `Sibz/github-status-action` was part of an unexecuted step due to
the lack of changes in these directories, preventing the Github action from
setting the commit status as successful. This commit updates the Github
workflow to address this issue.

Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
aanm committed Feb 21, 2023
1 parent 969108a commit add0f67
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/tests-l4lb-v1.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ jobs:
- 'test/l4lb/**'
- 'images/**'
skip-test-run:
# If the modified files are not relevant for this test then we can skip
# this test and mark it as successful.
if: github.event.comment.body == '/test' && needs.check_changes.outputs.tested == 'false'
runs-on: ubuntu-latest
needs: check_changes
steps:
- name: Set commit status to success
uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.vars.outputs.sha }}
context: ${{ github.workflow }}
description: L4LB test skipped
state: success
target_url: ${{ env.check_url }}

# This job is skipped when the workflow was triggered with the generic `/test`
# trigger if the only modified files were under `test/` or `Documentation/`.
setup-and-test:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/tests-l4lb-v1.11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ jobs:
- 'test/l4lb/**'
- 'images/**'
skip-test-run:
# If the modified files are not relevant for this test then we can skip
# this test and mark it as successful.
if: github.event.comment.body == '/test' && needs.check_changes.outputs.tested == 'false'
runs-on: ubuntu-latest
needs: check_changes
steps:
- name: Set commit status to success
uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.vars.outputs.sha }}
context: ${{ github.workflow }}
description: L4LB test skipped
state: success
target_url: ${{ env.check_url }}

# This job is skipped when the workflow was triggered with the generic `/test`
# trigger if the only modified files were under `test/` or `Documentation/`.
setup-and-test:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/tests-l4lb-v1.12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ jobs:
- 'test/l4lb/**'
- 'images/**'
skip-test-run:
# If the modified files are not relevant for this test then we can skip
# this test and mark it as successful.
if: github.event.comment.body == '/test' && needs.check_changes.outputs.tested == 'false'
runs-on: ubuntu-latest
needs: check_changes
steps:
- name: Set commit status to success
uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.vars.outputs.sha }}
context: ${{ github.workflow }}
description: L4LB test skipped
state: success
target_url: ${{ env.check_url }}

# This job is skipped when the workflow was triggered with the generic `/test`
# trigger if the only modified files were under `test/` or `Documentation/`.
setup-and-test:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/tests-l4lb-v1.13.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ jobs:
- 'test/nat46x64/**'
- 'images/**'
skip-test-run:
# If the modified files are not relevant for this test then we can skip
# this test and mark it as successful.
if: github.event.comment.body == '/test' && needs.check_changes.outputs.tested == 'false'
runs-on: ubuntu-latest
needs: check_changes
steps:
- name: Set commit status to success
uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.vars.outputs.sha }}
context: ${{ github.workflow }}
description: L4LB test skipped
state: success
target_url: ${{ env.check_url }}

# This job is skipped when the workflow was triggered with the generic `/test`
# trigger if the only modified files were under `test/` or `Documentation/`.
setup-and-test:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/tests-l4lb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ jobs:
- 'test/nat46x64/**'
- 'images/**'
skip-test-run:
# If the modified files are not relevant for this test then we can skip
# this test and mark it as successful.
if: github.event.comment.body == '/test' && needs.check_changes.outputs.tested == 'false'
runs-on: ubuntu-latest
needs: check_changes
steps:
- name: Set commit status to success
uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.vars.outputs.sha }}
context: ${{ github.workflow }}
description: L4LB test skipped
state: success
target_url: ${{ env.check_url }}

# This job is skipped when the workflow was triggered with the generic `/test`
# trigger if the only modified files were under `test/` or `Documentation/`.
setup-and-test:
Expand Down

0 comments on commit add0f67

Please sign in to comment.