-
-
Notifications
You must be signed in to change notification settings - Fork 383
164 lines (162 loc) · 4.71 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Rust
on:
pull_request:
branches:
- main
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
default:
name: Cargo Test on ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Cache target
uses: actions/cache@v2
env:
cache-name: cache-default-target-and-lockfile
with:
path: |
target
Cargo.lock
~/.rustup
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
- name: linux coredump setup
if: ${{ runner.os == 'linux' }}
run: |
ulimit -c unlimited
echo "$PWD/core-dumps/corefile-%e-%p-%t" | sudo tee /proc/sys/kernel/core_pattern
mkdir core-dumps
- name: cargo test
run: |
rustup update --no-self-update
cargo test --release --no-default-features --features=for-internal-testing-only -- --nocapture
- uses: actions/upload-artifact@v2
if: ${{ failure() && runner.os == 'linux' }}
with:
name: linux-core-dumps
path: |
./core-dumps/*
./target/release/deps/test_*
examples:
name: Example Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache target
uses: actions/cache@v2
env:
cache-name: cache-examples-target-and-lockfile
with:
path: |
target
Cargo.lock
~/.rustup
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
- name: example tests
run: |
rustup update --no-self-update
cargo run --example playground
cargo run --example structured
cross-compile:
name: Cross Compile
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: cross compile
run: |
set -eo pipefail
echo "cross build"
scripts/cross_compile.sh
burn-in:
name: Burn In
env:
RUST_BACKTRACE: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache target
uses: actions/cache@v2
env:
cache-name: cache-stress2-asan-target-and-lockfile
with:
path: |
benchmarks/stress2/target
benchmarks/stress2/Cargo.lock
~/.rustup
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
- name: burn in
run: |
set -eo pipefail
pushd benchmarks/stress2
ulimit -c unlimited
echo "$PWD/core-dumps/corefile-%e-%p-%t" | sudo tee /proc/sys/kernel/core_pattern
mkdir core-dumps
rustup toolchain install nightly
rustup toolchain install nightly --component rust-src
rustup update
rm -rf default.sled || true
export RUSTFLAGS="-Z sanitizer=address"
export ASAN_OPTIONS="detect_odr_violation=0"
cargo +nightly build --release --target x86_64-unknown-linux-gnu
target/x86_64-unknown-linux-gnu/release/stress2 --duration=240
rm -rf default.sled
- name: print backtraces with gdb
if: ${{ failure() }}
run: |
sudo apt-get update
sudo apt-get install gdb
pushd benchmarks/stress2
echo "first backtrace:"
gdb target/release/stress2 core-dumps/* -batch -ex 'bt -frame-info source-and-location'
echo ""
echo ""
echo ""
echo "all backtraces:"
gdb target/release/stress2 core-dumps/* -batch -ex 't a a bt -frame-info source-and-location'
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: linux-core-dumps
path: |
./benchmarks/stress2/core-dumps/*
./benchmarks/stress2/target/release/stress2
sanitizers:
name: Sanitizers
env:
RUST_BACKTRACE: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache rustup
uses: actions/cache@v2
env:
cache-name: cache-sanitizers-target-and-lockfile
with:
path: |
~/.rustup
benchmarks/stress2/target
benchmarks/stress2/Cargo.lock
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
- name: sanitizers
run: |
set -eo pipefail
scripts/sanitizers.sh