mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 11:31:05 +00:00
to allow selective testing as well as selective list of required tests let's add a mapping of required jobs/tests in "skips.py" and a "gatekeaper" workflow that will ensure the expected required jobs were successful. Then we can only mark the "gatekeaper" as the required job and modify the logic to suit our needs. Fixes: #9237 Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
40 lines
1.4 KiB
YAML
40 lines
1.4 KiB
YAML
name: Kata Containers CI
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- 'main'
|
|
- 'stable-*'
|
|
types:
|
|
# Adding 'labeled' to the list of activity types that trigger this event
|
|
# (default: opened, synchronize, reopened) so that we can run this
|
|
# workflow when the 'ok-to-test' label is added.
|
|
# Reference: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
- labeled
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
skipper:
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }}
|
|
uses: ./.github/workflows/gatekeeper-skipper.yaml
|
|
with:
|
|
commit-hash: ${{ github.event.pull_request.head.sha }}
|
|
target-branch: ${{ github.event.pull_request.base.ref }}
|
|
|
|
kata-containers-ci-on-push:
|
|
needs: skipper
|
|
if: ${{ needs.skipper.outputs.skip_build != 'yes' }}
|
|
uses: ./.github/workflows/ci.yaml
|
|
with:
|
|
commit-hash: ${{ github.event.pull_request.head.sha }}
|
|
pr-number: ${{ github.event.pull_request.number }}
|
|
tag: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
|
|
target-branch: ${{ github.event.pull_request.base.ref }}
|
|
skip-test: ${{ needs.skipper.outputs.skip_test }}
|
|
secrets: inherit
|