-
Notifications
You must be signed in to change notification settings - Fork 19
263 lines (252 loc) · 8.92 KB
/
Copy pathci.yaml
File metadata and controls
263 lines (252 loc) · 8.92 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
name: ci
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: write
contents: write
issues: read
checks: write
pull-requests: write
jobs:
unit:
name: test / unit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- name: test all
run: cargo test_all
timeout-minutes: 5
env:
RUST_BACKTRACE: full
RUST_LOG: debug
e2e:
name: test / e2e
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- name: test e2e
run: cargo test_e2e
timeout-minutes: 60
env:
RUST_BACKTRACE: full
RUST_LOG: debug
node-addon-test:
name: test / node-addon
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup node
uses: the-guild-org/shared-config/setup@v1
with:
node-version-file: .node-version
- name: build
run: npm run build:debug
working-directory: lib/node-addon
- name: test
working-directory: lib/node-addon
run: npm test
build:
name: check / build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- name: build
run: cargo build --release
fmt:
name: check / fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
components: rustfmt
- name: cargo fmt
uses: actions-rust-lang/rustfmt@4066006ec54a31931b9b1fddfd38f2fdf2d27143 # v1
clippy:
name: check / clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
components: clippy
- name: cargo clippy
run: cargo clippy --all
benchmark:
strategy:
matrix:
include:
- name: "graphql-tools"
package: "./lib/graphql-tools"
- name: "query-planner"
package: "./lib/query-planner"
- name: "executor"
package: "./lib/executor"
name: benchmark / ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- if: matrix.name == 'executor'
name: Build subgraphs
run: cargo build --release -p subgraphs
- if: matrix.name == 'executor'
name: Run subgraphs
run: ./target/release/subgraphs & sleep 5
- name: Run benchmarks
run: cargo bench
working-directory: ${{ matrix.package }}
- name: Upload benchmark results
if: always() # Upload results even if benchmarks fail
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: ${{matrix.package}}-benchmark-results
path: ${{matrix.package}}/target/criterion
router-benchmark:
strategy:
matrix:
include:
- name: "default"
args: ""
config: bench/configs/default.config.yaml
- name: "no-dedupe"
args: ""
config: bench/configs/no-deduplication.config.yaml
- name: "hive-tracing"
# turns otlp http/grpc to noop
args: "--features noop_otlp_exporter"
config: bench/configs/hive-tracing.config.yaml
- name: "otlp-tracing"
# turns otlp http/grpc to noop
args: "--features noop_otlp_exporter"
config: bench/configs/otlp-tracing.config.yaml
name: benchmark / router / ${{ matrix.name }}
runs-on: ubuntu-latest
env:
NODE_NO_WARNINGS: true
NODE_ENV: production
GITHUB_PR: ${{ github.event.number }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- name: Setup K6
run: |
wget https://github.com/grafana/k6/releases/download/v0.37.0/k6-v0.37.0-linux-amd64.deb
sudo apt-get update
sudo apt-get install ./k6-v0.37.0-linux-amd64.deb
- name: Build subgraphs
run: cargo build --release -p subgraphs
- name: Run subgraphs
run: ./target/release/subgraphs & sleep 5
- name: Build router
run: cargo build --release -p hive-router ${{matrix.args}}
- name: Run router
run: |
./target/release/hive_router &
echo "$!" > router.pid
sleep 5
env:
ROUTER_CONFIG_FILE_PATH: ${{matrix.config}}
- name: Run k6 benchmark for ${{ github.ref }}
if: github.event_name == 'pull_request'
run: k6 run -e SUMMARY_PATH=./bench/results/pr bench/k6.js
- name: Checkout main branch in a separate directory
if: github.event_name == 'pull_request'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: main
path: main-branch
- name: Build router
if: github.event_name == 'pull_request'
run: cargo build --release -p hive-router ${{matrix.args}}
working-directory: main-branch
- name: Run router
if: github.event_name == 'pull_request'
run: |
kill $(cat router.pid)
./main-branch/target/release/hive_router &
sleep 5
env:
ROUTER_CONFIG_FILE_PATH: ${{matrix.config}}
- name: Run k6 benchmark for main
if: github.event_name == 'pull_request'
run: k6 run -e SUMMARY_PATH=./bench/results/main bench/k6.js
- name: Compare benchmark results
if: github.event_name == 'pull_request'
run: |
chmod +x ./bench/ci-detect-regression.sh
./bench/ci-detect-regression.sh
graphql-over-http:
name: test / graphql-over-http
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- name: setup node
uses: the-guild-org/shared-config/setup@v1
with:
node-version-file: .node-version
- name: Run Audits
run: npm run ci:test:graphql-over-http
working-directory: audits
- name: Publish Test Results for comparison
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: (!cancelled())
with:
check_name: test / graphql-over-http
comment_title: GraphQL over HTTP Audit Results
comment_mode: off
files: |
audits/reports/*.xml
federation-audit:
name: test / federation-audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: setup rust
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
- name: setup node
uses: the-guild-org/shared-config/setup@v1
with:
node-version-file: .node-version
- name: Run Audits
run: npm run test:federation-all
env:
GATEWAY_TIMEOUT: 1800000 # 30 minutes, to prevent CI timeout for long-running tests
working-directory: audits
continue-on-error: true # continue even if the test fails
- name: Upload logs
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: federation-audit-logs
path: |
./audits/logs/*.log
- name: Publish Test Results for comparison
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: (!cancelled())
with:
check_name: test / federation-audit
comment_title: Federation Audit Results
comment_mode: off
files: |
audits/reports/*.xml