1
1
name : " Tests: Integration"
2
2
3
- run-name : " Integration [${{ github.event.workflow_run.head_branch }}]: ${{ github.event.workflow_run.head_commit.message }}"
3
+ run-name : " Integration [${{ github.event_name }}: ${{ github. event.pull_request.head.sha || github.event.push.after || github.event.workflow_run.head_sha }}]: ${{ github.event.workflow_run.head_commit.message }}"
4
4
5
5
on :
6
- workflow_call :
7
- inputs :
8
- workflow :
9
- default : all
10
- type : string
11
6
workflow_dispatch :
12
7
inputs :
13
8
workflow :
14
9
description : Tests to run
15
10
required : true
16
11
type : choice
17
12
options :
13
+ - all
18
14
- run-integration-tests-cf-env
19
15
- run-integration-tests-cf-env-with-client-creds
20
16
# - run-integration-tests-cf-env-with-min-capi
21
17
- run-cats-cf-env
22
- workflow_run :
23
- workflows :
24
- - " Tests"
25
- types :
26
- - completed
27
18
push :
19
+ tags :
20
+ - " v9.*"
21
+ - " v8.*"
22
+ - " v7.*"
23
+ pull_request_target :
28
24
branches :
29
25
- main
26
+ - v9
30
27
- v8
31
28
- v7
32
-
29
+ paths-ignore :
30
+ - " doc/**"
31
+ - " .gitpod.yml"
32
+ - " README.md"
33
33
jobs :
34
+ get-sha :
35
+ runs-on : ubuntu-latest
36
+ outputs :
37
+ gitRef : ${{steps.calculate.outputs.ref}}
38
+ steps :
39
+ - id : calculate
40
+ run : |
41
+ if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
42
+ echo "checkout pull request head ${{ github.event.pull_request.head.sha }}"
43
+ echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
44
+ elif [[ "${{ github.event_name }}" == "push" ]]; then
45
+ echo "checkout push request ${{github.event.push.after}}"
46
+ echo "ref=${{github.event.push.after}}" >> $GITHUB_OUTPUT
47
+ else
48
+ echo "checkout else ${{ github.event.workflow_run.head_sha }}"
49
+ echo "ref=${{github.event.workflow_run.head_sha}}" >> $GITHUB_OUTPUT
50
+ fi
51
+ units :
52
+ name : Basic units to gate for integration tests
53
+ runs-on : ubuntu-latest
54
+ needs :
55
+ - get-sha
56
+ steps :
57
+ - name : Checkout
58
+ uses : actions/checkout@v4
59
+ with :
60
+ ref : ${{needs.get-sha.outputs.gitRef}}
61
+ - name : Set Up Go
62
+ uses : actions/setup-go@v5
63
+ with :
64
+ go-version-file : go.mod
65
+ check-latest : true
66
+ - name : Run Units
67
+ run : make units
34
68
run-integration-tests-cf-env :
35
69
name : Integration tests
36
- if : ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env' }}
70
+ needs :
71
+ - get-sha
72
+ - units
73
+ if : ${{ github.event_name != 'workflow_dispatch' || inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env' }}
37
74
uses : ./.github/workflows/tests-integration-reusable.yml
38
75
with :
39
76
capi-version : edge
40
77
run-with-client-creds : false
41
78
os : ubuntu-latest
42
79
name : Integration
80
+ gitRef : ${{needs.get-sha.outputs.gitRef}}
43
81
secrets : inherit
44
82
45
83
run-integration-tests-cf-env-with-client-creds :
46
84
name : client creds
47
- if : ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-client-creds' }}
85
+ needs :
86
+ - get-sha
87
+ - units
88
+ if : ${{ github.event_name != 'workflow_dispatch' || inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-client-creds' }}
48
89
uses : ./.github/workflows/tests-integration-reusable.yml
49
90
with :
50
91
capi-version : edge
51
92
run-with-client-creds : true
52
93
os : ubuntu-latest
53
94
name : Integration client creds
95
+ gitRef : ${{needs.get-sha.outputs.gitRef}}
54
96
secrets : inherit
55
97
56
98
# run-integration-tests-cf-env-with-min-capi:
57
99
# name: MIN CAPI
58
- # if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }}
100
+ # needs:
101
+ # - get-sha
102
+ # - units
103
+ # if: ${{ github.event_name != 'workflow_dispatch' || inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }}
59
104
# uses: ./.github/workflows/tests-integration-reusable.yml
60
105
# with:
61
106
# capi-version: min
@@ -70,13 +115,15 @@ jobs:
70
115
run-cats-cf-env :
71
116
name : CATS
72
117
needs :
118
+ - get-sha
73
119
- run-integration-tests-cf-env
74
120
- run-integration-tests-cf-env-with-client-creds
75
- if : ${{ inputs.workflow == 'all' || inputs.workflow == 'run-cats-cf-env' }}
121
+ if : ${{ github.event_name != 'workflow_dispatch' || inputs.workflow == 'all' || inputs.workflow == 'run-cats-cf-env' }}
76
122
uses : ./.github/workflows/tests-integration-reusable.yml
77
123
with :
78
124
capi-version : edge
79
125
run-with-client-creds : false
80
126
os : ubuntu-latest
81
127
name : cats
128
+ gitRef : ${{needs.get-sha.outputs.gitRef}}
82
129
secrets : inherit
0 commit comments