-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (90 loc) · 2.83 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
name: ci
on:
pull_request:
push:
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: ["stable", "nightly"]
no_std: [true, false]
debug: [true, false]
unsafe_impl: [true, false]
ptr_metadata: [true, false]
error_in_core: [true, false]
allocator_api: [true, false]
exclude:
- rust: stable
ptr_metadata: true
- rust: stable
error_in_core: true
- rust: stable
allocator_api: true
# no point in testing nightly with unstable features disabled
- rust: nightly
ptr_metadata: false
- rust: nightly
error_in_core: false
- rust: nightly
allocator_api: false
runs-on: ${{ matrix.os }}
name: |
test - ${{ matrix.os }}; ${{ matrix.rust }} rust; features: {
no_std: ${{ matrix.no_std }},
debug: ${{ matrix.debug }},
unsafe_impl: ${{ matrix.unsafe_impl }},
ptr_metadata: ${{ matrix.ptr_metadata }},
error_in_core: ${{ matrix.error_in_core }},
allocator_api: ${{ matrix.allocator_api }}
}
env:
RUST_BACKTRACE: 1 # Emit backtraces on panics.
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- if: matrix.no_std == true
run: echo "FEATURES=$FEATURES,no_std" >> $GITHUB_ENV
- if: matrix.debug == true
run: echo "FEATURES=$FEATURES,debug" >> $GITHUB_ENV
- if: matrix.unsafe_impl == true
run: echo "FEATURES=$FEATURES,unsafe_impl" >> $GITHUB_ENV
- if: matrix.ptr_metadata == true
run: echo "FEATURES=$FEATURES,ptr_metadata" >> $GITHUB_ENV
- if: matrix.error_in_core == true
run: echo "FEATURES=$FEATURES,error_in_core" >> $GITHUB_ENV
- if: matrix.allocator_api == true
run: echo "FEATURES=$FEATURES,allocator_api" >> $GITHUB_ENV
- run: cargo test --no-default-features --features=${{ env.FEATURES }} --verbose
lint:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
override: true
- run: cargo clippy --all-features -- -D warnings # Deny clippy warnings
miri:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Install Miri
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: miri
override: true
- run: cargo miri setup
- run: cargo miri test --all-features --verbose