-
Notifications
You must be signed in to change notification settings - Fork 1.6k
147 lines (121 loc) · 4.15 KB
/
test.yml
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
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:
AWS_ACCESS_KEY_ID: "dummy"
AWS_SECRET_ACCESS_KEY: "dummy"
CONTAINER_TOOL: "docker"
DD_ENV: "ci"
DD_API_KEY: ${{ secrets.DD_API_KEY }}
RUST_BACKTRACE: full
TEST_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
with:
base_ref: ${{ github.event.merge_group.base_ref || github.event.pull_request.base.ref }}
head_ref: ${{ github.event.merge_group.head_ref || github.event.pull_request.head.ref }}
checks:
name: Checks
runs-on: ubuntu-20.04-8core
timeout-minutes: 60
needs: changes
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v4
with:
# check-version needs tags
fetch-depth: 0 # fetch everything
- uses: actions/cache@v4
name: Cache Cargo registry + index
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh
- uses: ruby/setup-ruby@v1
- run: bash scripts/environment/prepare.sh
- name: Enable Rust matcher
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Check code format
run: make check-fmt
- name: Check clippy
if: needs.changes.outputs.source == 'true'
run: make check-clippy
- name: Unit - x86_64-unknown-linux-gnu
if: needs.changes.outputs.source == 'true'
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()
- name: Check version
run: make check-version
- name: Check scripts
run: make check-scripts
- name: Check events
if: needs.changes.outputs.source == 'true'
run: make check-events
- name: Check that the 3rd-party license file is up to date
if: needs.changes.outputs.dependencies == 'true'
run: make check-licenses
- name: Check Cue docs
if: needs.changes.outputs.cue == 'true'
run: make check-docs
- name: Check Markdown
if: needs.changes.outputs.markdown == 'true'
run: make check-markdown
- name: Check Component Docs
if: needs.changes.outputs.source == 'true' || needs.changes.outputs.component_docs == 'true'
run: make check-component-docs
- name: Check Rust Docs
if: needs.changes.outputs.source == 'true'
run: cd rust-doc && make docs
- name: VRL - Linux
if: needs.changes.outputs.source == 'true' || needs.changes.outputs.cue == 'true'
run: cargo vdev test-vrl
- name: Build VRL Playground
if: needs.changes.outputs.source == 'true' || needs.changes.outputs.dependencies == 'true'
run: |
cd lib/vector-vrl/web-playground/
wasm-pack build --target web --out-dir public/pkg
# This is a required status check, so it always needs to run if prior jobs failed, in order to mark the status correctly.
all-checks:
name: Test Suite
runs-on: ubuntu-20.04
timeout-minutes: 5
if: always()
needs: [changes, checks]
env:
FAILED: ${{ contains(needs.*.result, 'failure') }}
steps:
- run: |
echo "failed=${{ env.FAILED }}"
if [[ "$FAILED" == "true" ]] ; then
exit 1
else
exit 0
fi