-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (169 loc) · 6.55 KB
/
ci.yml
File metadata and controls
191 lines (169 loc) · 6.55 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: CI
run-name: >-
${{ github.event_name == 'pull_request' && format('PR-CI #{0}', github.event.pull_request.number)
|| github.event_name == 'merge_group' && 'MergeQueue-CI'
|| github.event_name == 'push' && 'Main-CI'
|| 'CI' }}
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
merge_group:
permissions:
contents: read
jobs:
# ---------------------------------------------------------------------------
# LINT (gofmt via Go SDK, yamlfmt via go run)
# ---------------------------------------------------------------------------
lint:
name: Lint
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run linters
run: make lint
# ---------------------------------------------------------------------------
# TIDY (module files + BUILD files in sync)
# ---------------------------------------------------------------------------
tidy:
name: Tidy
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Check module files are tidy
run: make check-tidy
- name: Check BUILD files are up to date
run: make check-gazelle
# ---------------------------------------------------------------------------
# BUILD AND UNIT TESTS
# ---------------------------------------------------------------------------
build-and-unit-test:
name: Build and Unit Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build project
run: make build
- name: Run unit tests
run: make test
# ---------------------------------------------------------------------------
# INTEGRATION TESTS (e2e, gateway, orchestrator)
# ---------------------------------------------------------------------------
e2e:
name: E2E Integration Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run E2E tests
run: make e2e-test
gateway-integration-test:
name: Gateway Integration Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run Gateway integration tests
run: make integration-test-submitqueue-gateway
orchestrator-integration-test:
name: Orchestrator Integration Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run Orchestrator integration tests
run: make integration-test-submitqueue-orchestrator
# ---------------------------------------------------------------------------
# EXTENSION TESTS
# ---------------------------------------------------------------------------
counter-integration-test:
name: Counter Extension Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/extension/counter/...
queue-integration-test:
name: Queue Extension Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/extension/messagequeue/...
storage-integration-test:
name: Storage Extension Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/submitqueue/extension/storage/...
# ---------------------------------------------------------------------------
# CORE TESTS
# ---------------------------------------------------------------------------
consumer-integration-test:
name: Consumer Integration Test
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/submitqueue/core/consumer/...
# ---------------------------------------------------------------------------
# REQUIRED CHECKS GATE
#
# Fan-in aggregator that must turn RED when any required job fails or is
# cancelled. `if: always()` is critical: without it, this job is skipped
# when any `needs` dependency fails, and GitHub treats a skipped required
# status check as "not failed" — which let PR #151 merge through the
# merge queue despite failing e2e + orchestrator integration tests.
# ---------------------------------------------------------------------------
required-checks:
name: Required Checks
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-latest
needs:
- lint
- tidy
- build-and-unit-test
- e2e
- gateway-integration-test
- orchestrator-integration-test
- counter-integration-test
- queue-integration-test
- storage-integration-test
- consumer-integration-test
steps:
- name: Fail if any required check did not succeed
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
run: |
echo "One or more required checks did not succeed:" >&2
echo '${{ toJSON(needs) }}' >&2
exit 1
- name: All required checks passed
run: echo "All required checks passed!"