-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (150 loc) · 4.67 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
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
name: CI
on:
push:
branches:
- main
pull_request:
env:
CARGO_INCREMENTAL: '0'
CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS: -Dwarnings # https://github.com/rust-lang/cargo/issues/4423#issuecomment-404188918
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS: -Dwarnings # https://github.com/rust-lang/cargo/issues/4423#issuecomment-404188918
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -Dwarnings # https://github.com/rust-lang/cargo/issues/4423#issuecomment-404188918
RUST_BACKTRACE: short
RUST_LOG: callbag=trace,info
RUSTFLAGS: -Dwarnings
jobs:
clippy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, beta, nightly]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Cargo home
uses: ./.github/actions/cache-cargo-home
continue-on-error: true
- name: Install Rust
id: install-rust
uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown wasm32-wasi
components: clippy
- name: Cache Cargo build
uses: ./.github/actions/cache-cargo-build
with:
rustc-commit-hash: ${{ steps.install-rust.outputs.rustc-commit-hash }}
profile: dev
continue-on-error: true
- name: Run Clippy
uses: ./.github/actions/cargo
with:
command: clippy
toolchain: ${{ matrix.rust }}
args: --tests
- name: Run Clippy (wasm32-unknown-unknown)
uses: ./.github/actions/cargo
with:
command: clippy
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
args: --tests
- name: Run Clippy (wasm32-wasi)
uses: ./.github/actions/cargo
with:
command: clippy
toolchain: ${{ matrix.rust }}
target: wasm32-wasi
args: --tests
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, beta, nightly]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Cargo home
uses: ./.github/actions/cache-cargo-home
continue-on-error: true
- name: Install Rust
id: install-rust
uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown wasm32-wasi
- name: Cache Cargo build
uses: ./.github/actions/cache-cargo-build
with:
rustc-commit-hash: ${{ steps.install-rust.outputs.rustc-commit-hash }}
profile: test
continue-on-error: true
- name: Run tests
uses: ./.github/actions/cargo
with:
command: test
toolchain: ${{ matrix.rust }}
args: --no-fail-fast --features tracing -- --nocapture --test-threads=1
- name: Install wasm-pack
uses: ./.github/actions/install-wasm-pack
- name: Run tests (wasm32-unknown-unknown, node)
run: rustup run ${{ matrix.rust }} wasm-pack test --node -- --features tracing
- name: Install cargo-wasi
uses: ./.github/actions/cargo
with:
command: install
args: cargo-wasi
- name: Install Wasmtime
uses: ./.github/actions/install-wasmtime
- name: Run tests (wasm32-wasi)
uses: ./.github/actions/cargo
with:
command: wasi
toolchain: ${{ matrix.rust }}
args: test --no-fail-fast --features tracing -- --nocapture --test-threads=1
- name: Run doctests
uses: ./.github/actions/cargo
with:
command: test
toolchain: ${{ matrix.rust }}
args: --doc
rustdoc:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta, nightly]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- name: Run Rustdoc
uses: actions-rs/cargo@v1
with:
command: doc
toolchain: ${{ matrix.rust }}
args: --no-deps
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: ./.github/actions/install-rust
with:
toolchain: stable
components: rustfmt
- name: Run Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
toolchain: stable
args: --check