-
Notifications
You must be signed in to change notification settings - Fork 115
70 lines (67 loc) · 2.39 KB
/
rust.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test ${{ matrix.target }}
strategy:
fail-fast: true
matrix:
include:
#- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
#- { target: x86_64-apple-darwin, os: macos-latest }
#- {
#target: x86_64-pc-windows-gnu,
#os: windows-latest,
#host: -x86_64-pc-windows-gnu,
#}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# This has a matcher for test panics, so we use it even though elsewhere
# we use actions-rs/toolchain.
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable${{ matrix.host }}
targets: ${{ matrix.target }}
components: 'rustfmt, clippy'
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets --workspace --features bundled -- -D warnings -A clippy::redundant-closure
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
# Intentionally omit time feature until we're on time 0.3, at which
# point it should be added to `bundled-full`.
args: '--features "bundled" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
sanitizer:
name: Address Sanitizer
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Need nightly rust.
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: rust-src
- name: Tests with asan
env:
RUSTFLAGS: -Zsanitizer=address
RUSTDOCFLAGS: -Zsanitizer=address
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=1"
# Work around https://github.com/rust-lang/rust/issues/59125 by
# disabling backtraces. In an ideal world we'd probably suppress the
# leak sanitization, but we don't care about backtraces here, so long
# as the other tests have them.
RUST_BACKTRACE: "0"
run: cargo -Z build-std test --features 'bundled' --target x86_64-unknown-linux-gnu