-
Notifications
You must be signed in to change notification settings - Fork 2k
217 lines (196 loc) · 6.87 KB
/
test.yml
File metadata and controls
217 lines (196 loc) · 6.87 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
name: Test Suite
on:
pull_request:
merge_group:
types: [checks_requested]
concurrency:
# `github.ref` is unique for MQ runs and PRs
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CONTAINER_TOOL: "docker"
DD_ENV: "ci"
DD_API_KEY: ${{ secrets.DD_API_KEY }}
RUST_BACKTRACE: full
CARGO_TERM_COLOR: always
VECTOR_LOG: vector=debug
VERBOSE: true
CI: true
PROFILE: debug
# observing issues fetching boringssl via HTTPS in the OSX build, seeing if this helps
# can be removed when we switch back to the upstream openssl-sys crate
CARGO_NET_GIT_FETCH_WITH_CLI: true
jobs:
changes:
uses: ./.github/workflows/changes.yml
secrets: inherit
check-fmt:
name: Check code format
runs-on: ubuntu-24.04
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: make check-fmt
check-clippy:
name: Check clippy
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: sudo bash ./scripts/environment/install-protoc.sh
- run: sudo apt-get update && sudo apt-get install -y libsasl2-dev
- run: make check-clippy
test:
name: Unit and Component Validation tests - x86_64-unknown-linux-gnu
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
- run: bash ./scripts/environment/prepare.sh --modules=cargo-nextest,datadog-ci
- name: Unit Test
run: make test
env:
CARGO_BUILD_JOBS: 5
# Validates components for adherence to the Component Specification
- name: Check Component Spec
run: make test-component-validation
- name: Upload test results
run: scripts/upload-test-results.sh
if: always()
check-version:
name: Check version
runs-on: ubuntu-24.04
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- run: make check-version
check-scripts:
name: Check scripts
runs-on: ubuntu-24.04
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: make check-scripts
check-events:
name: Check events
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: make check-events
check-licenses:
name: Check that the 3rd-party license file is up to date
runs-on: ubuntu-24.04
if: needs.changes.outputs.dependencies == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: bash ./scripts/environment/prepare.sh --modules=dd-rust-license-tool
- run: make check-licenses
check-docs:
name: Check Cue docs
runs-on: ubuntu-24.04
if: needs.changes.outputs.cue == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
- run: make check-docs
check-markdown:
name: Check Markdown
runs-on: ubuntu-24.04
if: needs.changes.outputs.markdown == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: bash ./scripts/environment/prepare.sh --modules=markdownlint
- run: make check-markdown
check-component-docs:
name: Check Component Docs
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true' || needs.changes.outputs.component_docs == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: sudo bash ./scripts/environment/install-protoc.sh
- run: sudo apt-get update && sudo apt-get install -y libsasl2-dev
- run: sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
- run: make check-component-docs
check-rust-docs:
name: Check Rust Docs
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: cd rust-doc && make docs
test-vrl:
name: VRL - Linux
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true' || needs.changes.outputs.cue == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: sudo bash ./scripts/environment/install-protoc.sh
- run: bash ./scripts/environment/prepare.sh --modules=wasm-pack
- run: make test-vrl
build-vrl-playground:
name: Build VRL Playground
runs-on: ubuntu-24.04-8core
if: needs.changes.outputs.source == 'true' || needs.changes.outputs.dependencies == 'true'
needs: changes
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- run: bash ./scripts/environment/prepare.sh --modules=wasm-pack
- run: |
cd lib/vector-vrl/web-playground/
rustup target add wasm32-unknown-unknown
wasm-pack build --target web --out-dir public/pkg
all-checks:
name: Test Suite
runs-on: ubuntu-24.04
if: always()
needs:
- changes
- check-fmt
- check-clippy
- test
- check-version
- check-scripts
- check-events
- check-licenses
- check-docs
- check-markdown
- check-component-docs
- check-rust-docs
- test-vrl
- build-vrl-playground
steps:
- name: Check all jobs status
run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
else
echo "All jobs completed successfully"
fi