7
7
paths-ignore :
8
8
- ' **.md'
9
9
- " containers/**"
10
- pull_request :
11
- types : [opened, synchronize]
12
- paths-ignore :
13
- - ' **.md'
14
- - " containers/**"
10
+ workflow_dispatch :
15
11
16
12
concurrency :
17
13
group : ${{ github.workflow }}-${{ github.ref }}
26
22
#
27
23
# NOTE: Current Cybozu internal use version is 8.0.28.
28
24
jobs :
25
+ commit-status-start :
26
+ name : Commit status start
27
+ runs-on : ubuntu-22.04
28
+ steps :
29
+ - name : Set pending to commit status
30
+ uses : myrotvorets/set-commit-status-action@38f3f27c7d52fb381273e95542f07f0fba301307 # v2.0.0
31
+ with :
32
+ sha : ${{ github.sha }}
33
+ extract-github-ref :
34
+ name : extract github.ref
35
+ runs-on : ubuntu-22.04
36
+ outputs :
37
+ github_ref : ${{ steps.extract.outputs.github_ref }}
38
+ steps :
39
+ - uses : actions/checkout@v4
40
+ - name : Extract github.ref
41
+ id : extract
42
+ env :
43
+ GH_TOKEN : ${{ github.token }}
44
+ run : |
45
+ # if exists PR refs/pull/<pull_request_number>/merge
46
+ # if not exists PR → github.ref
47
+ PR_number=$(gh pr view --json number -q .number)
48
+ if [ $? == 0 ];then
49
+ echo "github_ref=refs/pull/${PR_number}/merge" >> $GITHUB_OUTPUT
50
+ else
51
+ echo "github_ref=${{ github.ref }}" >> $GITHUB_OUTPUT
52
+ fi
29
53
dbtest :
30
54
name : Integration tests with MySQL
55
+ needs : extract-github-ref
31
56
strategy :
32
57
matrix :
33
58
mysql-version : ["8.0.28", "8.0.34", "8.0.35"]
34
59
uses : ./.github/workflows/dbtest.yaml
35
60
with :
36
61
mysql-version : ${{ matrix.mysql-version }}
62
+ ref : ${{ needs.extract-github-ref.outputs.github_ref }}
37
63
38
64
e2e :
39
65
name : Supported Kubernetes versions End-to-End Tests
66
+ needs : extract-github-ref
40
67
strategy :
41
68
matrix :
42
69
mysql-version : ["8.0.35"]
45
72
with :
46
73
k8s-version : ${{ matrix.k8s-version }}
47
74
mysql-version : ${{ matrix.mysql-version }}
75
+ ref : ${{ needs.extract-github-ref.outputs.github_ref }}
48
76
49
77
e2e-mysql :
50
78
name : Supported MySQL versions End-to-End Tests
79
+ needs : extract-github-ref
51
80
strategy :
52
81
matrix :
53
82
mysql-version : ["8.0.28", "8.0.34", "8.0.35"]
@@ -56,13 +85,17 @@ jobs:
56
85
with :
57
86
k8s-version : ${{ matrix.k8s-version }}
58
87
mysql-version : ${{ matrix.mysql-version }}
88
+ ref : ${{ needs.extract-github-ref.outputs.github_ref }}
59
89
60
90
upgrade :
61
91
name : Upgrade Test
92
+ needs : extract-github-ref
62
93
runs-on :
63
94
group : moco
64
95
steps :
65
96
- uses : actions/checkout@v4
97
+ with :
98
+ ref : ${{ needs.extract-github-ref.outputs.github_ref }}
66
99
- uses : actions/setup-go@v4
67
100
with :
68
101
go-version-file : go.mod
@@ -84,3 +117,26 @@ jobs:
84
117
with :
85
118
name : logs-upgrade.tar.gz
86
119
path : e2e/logs.tar.gz
120
+ commit-status-final :
121
+ if : always()
122
+ name : Commit Status Final
123
+ needs :
124
+ - dbtest
125
+ - e2e
126
+ - e2e-mysql
127
+ - upgrade
128
+ runs-on : ubuntu-latest
129
+ steps :
130
+ - name : Get final status
131
+ id : final-status
132
+ run : |
133
+ if "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}"; then
134
+ echo "result=failure" >> $GITHUB_OUTPUT
135
+ else
136
+ echo "result=success" >> $GITHUB_OUTPUT
137
+ fi
138
+ - name : Set final commit status
139
+ uses : myrotvorets/set-commit-status-action@38f3f27c7d52fb381273e95542f07f0fba301307 # v2.0.0
140
+ with :
141
+ sha : ${{ github.sha }}
142
+ status : ${{ steps.final-status.outputs.result }}
0 commit comments