-
Notifications
You must be signed in to change notification settings - Fork 1.6k
137 lines (112 loc) · 3.92 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
name: Test Suite
on:
pull_request:
merge_group:
types: [checks_requested]
concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
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: [linux, ubuntu-20.04-8core]
needs: changes
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v3
with:
# check-version needs tags
fetch-depth: 0 # fetch everything
- uses: actions/cache@v3
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
# Remove this once https://github.com/vectordotdev/vector/issues/3771 is closed.
# Then, modify the `cross-linux` job to run `test` instead of `build`.
- name: Unit - x86_64-unknown-linux-gnu
run: make test
env:
CARGO_BUILD_JOBS: 5
- 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
# 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
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