mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-03-18 10:44:10 +00:00
some tests require certain labels before they are executed. When our PR is not labeled appropriately the gatekeeper detects skipped required tests and reports a failure. With this change we add "required-labeles" to the tests mapping and check the expected labels first informing the user about the missing labeles before even checking the test statuses. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: Gatekeeper
|
|
|
|
# Gatekeeper uses the "skips.py" to determine which job names/regexps are
|
|
# required for given PR and waits for them to either complete or fail
|
|
# reporting the status.
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
- labeled
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
gatekeeper:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
fetch-depth: 0
|
|
- id: gatekeeper
|
|
env:
|
|
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
run: |
|
|
#!/usr/bin/env bash -x
|
|
mapfile -t lines < <(python3 tools/testing/gatekeeper/skips.py -t)
|
|
export REQUIRED_JOBS="${lines[0]}"
|
|
export REQUIRED_REGEXPS="${lines[1]}"
|
|
export REQUIRED_LABELS="${lines[2]}"
|
|
echo "REQUIRED_JOBS: $REQUIRED_JOBS"
|
|
echo "REQUIRED_REGEXPS: $REQUIRED_REGEXPS"
|
|
echo "REQUIRED_LABELS: $REQUIRED_LABELS"
|
|
python3 tools/testing/gatekeeper/jobs.py
|
|
exit $?
|
|
shell: /usr/bin/bash -x {0}
|