-
Notifications
You must be signed in to change notification settings - Fork 531
201 lines (188 loc) · 6.75 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
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
name: All Tests and Builds
env:
# It's really `--all-features`, but not adding the mutually exclusive features from rkyv
ALL_NON_EXCLUSIVE_FEATURES: --features "default unstable-locales rkyv-32 rkyv-validation rustc-serialize serde arbitrary"
on:
push:
branches: [main, 0.4.x]
pull_request:
jobs:
timezones:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
tz: ["ACST-9:30", "EST4", "UTC0", "Asia/Katmandu"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
# later this may be able to be included with the below
# kept separate for now as the following don't compile on 1.60
# * arbitrary (requires 1.63 as of v1.3.0)
rust_msrv:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.61.0"
- uses: Swatinem/rust-cache@v2
# run --lib and --doc to avoid the long running integration tests
# which are run elsewhere
- run: |
cargo test --lib \
--features \
unstable-locales,wasmbind,oldtime,clock,rustc-serialize,winapi,serde \
--color=always -- --color=always
- run: |
cargo test --doc \
--features \
unstable-locales,wasmbind,oldtime,clock,rustc-serialize,winapi,serde \
--color=always -- --color=always
rust_versions:
strategy:
matrix:
os: [ubuntu-latest]
rust_version: ["stable", "beta", "nightly"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_version }}
- uses: Swatinem/rust-cache@v2
- run: cargo check --manifest-path bench/Cargo.toml --benches
- run: cargo check --manifest-path fuzz/Cargo.toml --all-targets
# run --lib and --doc to avoid the long running integration tests
# which are run elsewhere
- run: cargo test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
- run: cargo test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --color=always -- --color=always
features_check:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- run: |
cargo hack check --feature-powerset --optional-deps arbitrary,serde \
--skip __internal_bench,iana-time-zone,pure-rust-locales,libc,winapi,rkyv-16,rkyv-64,rkyv-validation \
--all-targets
# run using `bash` on all platforms for consistent
# line-continuation marks
shell: bash
env:
RUSTFLAGS: "-D warnings"
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features=alloc
- run: cargo test --no-default-features --features=unstable-locales
- run: cargo test --no-default-features --features=alloc,unstable-locales
- run: cargo test --no-default-features --features=now
no_std:
strategy:
matrix:
os: [ubuntu-latest]
target: [thumbv6m-none-eabi, x86_64-fortanix-unknown-sgx]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --target ${{ matrix.target }} --color=always
working-directory: ./ci/core-test
alternative_targets:
strategy:
matrix:
os: [ubuntu-latest]
target:
[
wasm32-unknown-emscripten,
aarch64-apple-ios,
aarch64-linux-android,
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --target ${{ matrix.target }} --color=always
test_wasm:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
- uses: jetli/wasm-pack-action@v0.4.0
# The `TZ` and `NOW` variables are used to compare the results inside the WASM environment
# with the host system.
- run: TZ="$(date +%z)" NOW="$(date +%s)" wasm-pack test --node -- --features wasmbind
test_wasi:
strategy:
matrix:
os: [ubuntu-latest]
target:
- wasm32-wasi
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasi
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-wasi
- uses: mwilliamson/setup-wasmtime-action@v2
with:
wasmtime-version: "12.0.1"
# We can't use `--all-features` because `rustc-serialize` doesn't support
# `wasm32-wasi`.
- run: cargo wasi test --features=serde,unstable-locales --color=always -- --color=always
cross-targets:
strategy:
matrix:
target:
- x86_64-sun-solaris
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo install cross
- uses: Swatinem/rust-cache@v2
- run: cross check --target ${{ matrix.target }}
cross-tests:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: cargo install cross
- uses: Swatinem/rust-cache@v2
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-gnu --color=always
- run: cross test --lib ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
- run: cross test --doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --target i686-unknown-linux-musl --color=always
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly doc ${{ env.ALL_NON_EXCLUSIVE_FEATURES }} --no-deps
env:
RUSTDOCFLAGS: "-D warnings --cfg docsrs"