-
Notifications
You must be signed in to change notification settings - Fork 22
58 lines (52 loc) · 1.54 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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:
# Use a job that does nothing but has an environment as a guard to control
# access to the rest of workflow
# This allows us to control access to test infra for concurrenct and approval reasons
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 }}
test:
needs: [mirror_container_images, ensure_capi_images]
uses: ./.github/workflows/test.yaml
secrets: inherit
with:
# Pass the images as JSON
images: ${{ toJSON(needs.ensure_capi_images.outputs) }}
# 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 }}