Skip to content

Allow CRD2Go CI to run checks concurrently #14385

Allow CRD2Go CI to run checks concurrently

Allow CRD2Go CI to run checks concurrently #14385

Workflow file for this run

name: Test
on:
schedule:
- cron: '0 0 * * 1-5' # Run a nightly test
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- 'tools/**'
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, labeled]
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'tools/**'
merge_group:
workflow_dispatch:
inputs:
promote:
description: "Flag to indicate whether to run all tests and promote the image"
required: false
type: choice
default: "false"
options:
- "true"
- "false"
paths-ignore:
- 'docs/**'
- 'tools/**'
jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
# Contributions do NOT run any testing by default
# A label is needed to allow testing after every contributor code post
# This check makes pull_request_target event triggering by contributions safe
if: |
github.event.pull_request.base.repo.full_name == github.event.pull_request.head.repo.full_name ||
github.event.label.name == 'safe-to-test' ||
github.event.label.name == 'cloud-tests' ||
github.event.label.name == 'retest'
steps:
- name: allowed message
run: echo "Allowed to run tests"
lint:
needs:
- run-tests
uses: ./.github/workflows/lint.yaml
validate-manifests:
needs:
- run-tests
uses: ./.github/workflows/validate-manifests.yml
unit-tests:
needs:
- run-tests
uses: ./.github/workflows/test-unit.yml
secrets: inherit
license-header-check:
needs:
- run-tests
uses: ./.github/workflows/license-header-check.yml
check-licenses:
needs:
- run-tests
uses: ./.github/workflows/check-licenses.yml
cloud-tests-filter:
needs:
- run-tests
uses: ./.github/workflows/cloud-tests-filter.yml
tests-selectable:
needs:
- lint
- unit-tests
- validate-manifests
- check-licenses
- cloud-tests-filter
uses: ./.github/workflows/tests-selectable.yaml
secrets: inherit
e2e2:
needs:
- lint
- unit-tests
- validate-manifests
- check-licenses
- cloud-tests-filter
uses: ./.github/workflows/tests-e2e2.yaml
secrets: inherit
cloud-tests:
needs:
- lint
- unit-tests
- validate-manifests
- check-licenses
- cloud-tests-filter
if: |
github.event_name == 'merge_group' || needs.cloud-tests-filter.outputs.run-cloud-tests == 'true'
uses: ./.github/workflows/cloud-tests.yml
secrets: inherit
start-promote-image:
name: Start Promote Image
needs:
- lint
- unit-tests
- validate-manifests
- check-licenses
- e2e2
- cloud-tests
if: github.ref_name == 'main' && github.event_name != 'pull_request_target' && github.event_name != 'pull_request'
uses: ./.github/workflows/promote-image.yml
secrets: inherit