125 lines (118 loc) · 4.29 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
name: Tests
on:
push:
branches: [ master, '0.[0-9]+' ]
pull_request:
branches: [ master, '0.[0-9]+' ]
jobs:
check-doc:
name: Check doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
run: cargo install cargo-deadlinks
- name: doc (rand)
env:
RUSTDOCFLAGS: --cfg doc_cfg
# --all builds all crates, but with default features for other crates (okay in this case)
run: cargo deadlinks --ignore-fragments -- --all --features nightly,serde1,getrandom,small_rng
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: []
minimal: [false]
include:
- toolchain: [stable]
- os: ubuntu-latest
toolchain: [beta, 1.36.0, nightly]
- os: ubuntu-latest
minimal: true
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: Maybe minimal
if: ${{ matrix.minimal }}
run: cargo generate-lockfile -Z minimal-versions
- name: Maybe nightly
if: ${{ matrix.toolchain == 'nightly' }}
run: |
cargo test --tests --features=nightly
cargo test --all-features
cargo test --benches --features=nightly
cargo test --manifest-path rand_distr/Cargo.toml --benches
- name: Test rand
run: |
cargo test --tests --no-default-features
cargo test --tests --no-default-features --features=alloc,getrandom,small_rng
# all stable features:
cargo test --features=serde1,log,small_rng
cargo test --examples
- name: Test rand_core
run: |
cargo test --manifest-path rand_core/Cargo.toml
cargo test --manifest-path rand_core/Cargo.toml --no-default-features
cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc,getrandom
- name: Test rand_distr
run: cargo test --manifest-path rand_distr/Cargo.toml
- name: Test rand_pcg
run: cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
- name: Test rand_chacha
run: cargo test --manifest-path rand_chacha/Cargo.toml
- name: Test rand_hc
run: cargo test --manifest-path rand_hc/Cargo.toml
test-miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
run: |
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
rustup default "$MIRI_NIGHTLY"
- name: Test rand
run: |
cargo miri test --no-default-features
cargo miri test --features=log,small_rng
cargo miri test --manifest-path rand_core/Cargo.toml
cargo miri test --manifest-path rand_core/Cargo.toml --features=serde1
cargo miri test --manifest-path rand_core/Cargo.toml --no-default-features
#cargo miri test --manifest-path rand_distr/Cargo.toml # no unsafe and lots of slow tests
cargo miri test --manifest-path rand_pcg/Cargo.toml --features=serde1
cargo miri test --manifest-path rand_chacha/Cargo.toml --no-default-features
cargo miri test --manifest-path rand_hc/Cargo.toml
test-no-std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: thumbv6m-none-eabi
override: true
- name: Build top-level only
run: cargo build --target=thumbv6m-none-eabi --no-default-features
test-no-std:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: aarch64-apple-ios
override: true
- name: Build top-level only
run: cargo build --target=aarch64-apple-ios