-
Notifications
You must be signed in to change notification settings - Fork 28
131 lines (108 loc) · 3.18 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
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
name: ci
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
# When a new run is triggered by a commit while a run is already in progress,
# we want to cancel the in-progress run so as to not waste CI resources.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
# to fetch code (actions/checkout)
contents: read
env:
# https://doc.rust-lang.org/cargo/reference/config.html#registriescrates-ioprotocol
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
jobs:
test-wasm:
name: Test WASM
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-stable-test"
- name: Install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli
- name: Build xtask
run: cargo build --manifest-path ./xtask/Cargo.toml
- name: Run tests
run: cargo x test --wasm
test:
name: Test
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
strategy:
fail-fast: false
matrix:
build: [pinned, stable, nightly]
include:
- build: pinned
os: ubuntu-20.04
rust: 1.72
# Fails on pinned version because the output changed,
# so we're excluding it, but it's still tested on stable and nightly.
EXCLUDE_UI_TESTS: "pattern_mismatched_types,newtype,matches_unknown_field"
- build: stable
os: ubuntu-20.04
rust: stable
EXCLUDE_UI_TESTS: ""
- build: nightly
os: ubuntu-20.04
rust: nightly
EXCLUDE_UI_TESTS: "pattern_mismatched_types,non_unary_newtype"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-${{ matrix.build }}-test"
- name: Build xtask
run: cargo build-xtask
- name: Build docs
run: cargo doc --all-features
- name: Run tests
run: cargo x test
env:
EXCLUDE_UI_TESTS: ${{ matrix.EXCLUDE_UI_TESTS }}
checks:
name: Checks
runs-on: ubuntu-20.04
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-deny,cargo-audit,cargo-udeps,cargo-pants
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-checks"
- name: Build xtask
run: cargo build-xtask
- name: Run checks
run: cargo x check