68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
name: test pr
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- ready_for_review
|
|
- reopened
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ github.head_ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# This job does nothing, but uses an environment that has protection in place
|
|
# It is used as a guard to the rest of the workflow so that we can require approval
|
|
# for all commits to a PR
|
|
wait_for_approval:
|
|
runs-on: ubuntu-latest
|
|
environment: ci-approval
|
|
steps:
|
|
- name: Workflow approved
|
|
run: exit 0
|
|
|
|
lint:
|
|
needs: [wait_for_approval]
|
|
uses: ./.github/workflows/lint.yaml
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
mirror_container_images:
|
|
needs: [lint]
|
|
uses: ./.github/workflows/sync-images.yaml
|
|
secrets: inherit
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
ensure_capi_images:
|
|
needs: [lint]
|
|
uses: ./.github/workflows/ensure-capi-images.yaml
|
|
secrets: inherit
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
publish_charts:
|
|
needs: [lint]
|
|
uses: ./.github/workflows/publish-charts.yaml
|
|
secrets: inherit
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
test:
|
|
needs: [mirror_container_images, ensure_capi_images, publish_charts]
|
|
uses: ./.github/workflows/test.yaml
|
|
secrets: inherit
|
|
with:
|
|
# Pass the images as JSON
|
|
images: ${{ toJSON(needs.ensure_capi_images.outputs) }}
|
|
# Pass the chart version to test
|
|
chart-version: ${{ needs.publish_charts.outputs.chart-version }}
|
|
# We want to test the code in the PR
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
# If the PR is in draft, just run a sanity check
|
|
# If the PR is in review, run the full test suite
|
|
tests-full: ${{ !github.event.pull_request.draft }}
|