-
-
Notifications
You must be signed in to change notification settings - Fork 47
244 lines (190 loc) · 6.76 KB
/
ci.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
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
name: CI
on:
push:
branches:
- master
- release/**
pull_request:
env:
RUSTFLAGS: -Dwarnings
jobs:
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Install libcurl-dev
run: |
sudo apt update
sudo apt-get install -y libcurl4-openssl-dev
- name: Checkout sources
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install python dependencies
run: pip install --upgrade black flake8
- name: Run Black
run: black --check --diff tests
- name: Run Flake8
run: flake8 tests
- name: Install rust stable toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal --component rustfmt --component clippy
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v2
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-features --workspace --tests --examples
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Install libcurl-dev
run: |
sudo apt update
sudo apt-get install -y libcurl4-openssl-dev
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust stable toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v2
- name: Run cargo test
run: cargo test --workspace --all-features --locked
env:
SENTRY_SYMBOLICATOR_GCS_CLIENT_EMAIL: ${{ secrets.SENTRY_SYMBOLICATOR_GCS_CLIENT_EMAIL }}
SENTRY_SYMBOLICATOR_GCS_PRIVATE_KEY: ${{ secrets.SENTRY_SYMBOLICATOR_GCS_PRIVATE_KEY }}
SENTRY_SYMBOLICATOR_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.SENTRY_SYMBOLICATOR_TEST_AWS_ACCESS_KEY_ID }}
SENTRY_SYMBOLICATOR_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.SENTRY_SYMBOLICATOR_TEST_AWS_SECRET_ACCESS_KEY }}
GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Install libcurl-dev
run: |
sudo apt update
sudo apt-get install -y libcurl4-openssl-dev
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust stable toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v2
- name: Build rust
run: cargo build --locked
- name: Install python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup python environment
run: pip install --upgrade pytest pytest-localserver requests pytest-xdist pytest-icdiff boto3
- name: Integration tests
run: pytest -n12 -vv tests/integration
test_against_latest_sentry:
name: Sentry-Symbolicator Integration Tests
runs-on: ubuntu-latest
steps:
- name: Install libcurl-dev
run: |
sudo apt update
sudo apt-get install -y libcurl4-openssl-dev
- name: Checkout Symbolicator
uses: actions/checkout@v2
# Checkout Sentry and run integration tests against latest Symbolicator
- name: Checkout sentry
uses: actions/checkout@v2
with:
repository: getsentry/sentry
path: sentry
- name: Setup steps
id: setup
run: |
# We cannot execute actions that are not placed under .github of the main repo
mkdir -p .github/actions/
cp -r sentry/.github/actions/setup-sentry .github/actions/
- name: Setup Sentry
uses: ./.github/actions/setup-sentry
with:
workdir: sentry
kafka: true
snuba: true
cache-files-hash: ${{ hashFiles('sentry/requirements**.txt') }}
python-version: 3.8
- name: Install rust stable toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v2
- name: Build Symbolicator
run: cargo build --locked
- name: Run Symbolicator
run: ./target/debug/symbolicator run &
- name: Run Sentry's Symbolicator integration tests
working-directory: sentry
run: make test-symbolicator
doc-comments:
name: Rust doc comments
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- name: Install libcurl-dev
run: |
sudo apt update
sudo apt-get install -y libcurl4-openssl-dev
- name: Checkout sources
uses: actions/checkout@v2
- name: Install rust stable toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal --component rust-docs
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v2
- run: cargo doc --workspace --all-features --document-private-items --no-deps
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup python dependencies
run: pip install --upgrade mkdocs mkdocs-material pygments
- name: Build Docs
run: mkdocs build
# Code coverage instrumentation is current broken in recent Rust nightlies,
# as they fail processing with the following error:
# `Failed to load coverage: Truncated coverage data`
# https://github.com/taiki-e/cargo-llvm-cov/issues/128
codecov:
name: Code Coverage
runs-on: ubuntu-latest
continue-on-error: true # well, its nightly and highly experimental
steps:
- name: Install libcurl-dev
run: |
sudo apt update
sudo apt-get install -y libcurl4-openssl-dev
- uses: actions/checkout@v2
- name: Install rust stable toolchain
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal --component llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649
with:
files: lcov.info