-
-
Notifications
You must be signed in to change notification settings - Fork 8
158 lines (146 loc) · 5.9 KB
/
test.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
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
name: Test
on:
push:
branches: ["main"]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
build-test:
name:
${{ matrix.rust.pre_description }} ${{ matrix.driver.description }} ${{
matrix.rust.post_description }} ${{ matrix.features.description }}
runs-on: ${{ matrix.driver.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
driver:
- {
os: ubuntu-latest,
description: Chrome,
default: true,
name: CHROMEDRIVER,
value: chromedriver,
}
- { os: ubuntu-latest, description: Firefox, name: GECKODRIVER, value: geckodriver }
- { os: macos-latest, description: Safari, name: SAFARIDRIVER, value: safaridriver }
rust:
- { version: stable, pre_description: Build & Test, msrv: false }
- {
version: nightly,
pre_description: Build & Test,
post_description: with Atomics,
msrv: false,
component: --component rust-src,
flags: "-Ctarget-feature=+atomics,+bulk-memory",
args: "-Zbuild-std=panic_abort,std",
}
target:
- { target: wasm32-unknown-unknown, native: false, docargs: -Zdoctest-xcompile }
features:
- { features: "" }
- { features: --all-features, description: (all features) }
include:
- driver: { os: ubuntu-latest, description: Web, default: true }
rust: { version: "1.60", pre_description: Build, post_description: MSRV, msrv: true }
target: { target: wasm32-unknown-unknown, native: false }
features: { features: "" }
- driver: { os: ubuntu-latest, description: Native }
rust: { version: "1.60", pre_description: Build, post_description: MSRV, msrv: true }
target: { target: x86_64-unknown-linux-gnu, native: true }
features: { features: "" }
- driver: { os: ubuntu-latest, description: Native }
rust: { version: stable, pre_description: Build & Test, msrv: false }
target: { target: x86_64-unknown-linux-gnu, native: true }
features: { features: "" }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install `wasm-bindgen-cli`
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: wasm-bindgen-cli
git: https://github.com/daxpedda/wasm-bindgen
rev: 480a246aef12c59b26c3335a716e6940b369aeb7
- name: Install Rust
run: |
rustup toolchain install ${{ matrix.rust.version }} --profile minimal ${{ matrix.rust.component }} --target ${{ matrix.target.target }}
rustup default ${{ matrix.rust.version }}
- name: Fix MSRV dependencies
if: matrix.rust.msrv == true
run: |
cargo update -p bumpalo --precise 3.14.0
cargo update -p serde --precise 1.0.210
cargo update -p syn --precise 2.0.67
- name: Build
if: matrix.driver.default == true || matrix.target.native == true
env:
RUSTFLAGS: ${{ matrix.rust.flags }}
run:
cargo build ${{ matrix.features.features }} --target ${{ matrix.target.target }} ${{
matrix.rust.args }}
- name: Documentation
if: matrix.driver.default == true || matrix.target.native == true
env:
RUSTDOCFLAGS: ${{ matrix.rust.flags }}
RUSTFLAGS: ${{ matrix.rust.flags }}
run:
cargo doc --no-deps ${{ matrix.features.features }} --target ${{ matrix.target.target }}
${{ matrix.rust.args }}
- name: Set Driver
if: matrix.rust.msrv == false && matrix.target.native == false
run: echo "${{ matrix.driver.name }}=${{ matrix.driver.value }}" >> $GITHUB_ENV
- name: Test
if: matrix.rust.msrv == false
run:
cargo test ${{ matrix.features.features }} --all-targets --no-fail-fast --target ${{
matrix.target.target }} ${{ matrix.rust.args }}
- name: Switch to nightly Rust for Wasm documentation tests
if:
matrix.rust.msrv == false && matrix.target.native == false && matrix.rust.version !=
'nightly'
run: |
rustup toolchain install nightly --profile minimal --target ${{ matrix.target.target }}
rustup default nightly
- name: Documentation Test
if: matrix.rust.msrv == false
run:
cargo test ${{ matrix.features.features }} --doc --no-fail-fast --target ${{
matrix.target.target }} ${{ matrix.rust.args }} ${{ matrix.target.docargs }}
minimal-versions:
name:
Minimal Versions ${{ matrix.target.description }} ${{ matrix.rust.description }} ${{
matrix.features.description }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: minimal-versions
strategy:
fail-fast: false
matrix:
rust:
- { version: "1.60", description: MSRV }
- { version: stable }
target:
- { target: x86_64-unknown-linux-gnu, description: Native }
- { target: wasm32-unknown-unknown, description: Web }
features:
- { features: "" }
- { features: --all-features, description: (all features) }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup toolchain install ${{ matrix.rust.version }} --profile minimal --target ${{ matrix.target.target }}
rustup default ${{ matrix.rust.version }}
- name: Install Rust nightly
run: rustup toolchain install nightly --profile minimal
- name: Build
run: |
cargo +nightly update -Z minimal-versions
cargo build ${{ matrix.features.features }} --target ${{ matrix.target.target }}