-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.93 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
name: CI
on:
push:
branches:
- main
- staging
- trying
pull_request:
env:
RUSTFLAGS: -Cdebuginfo=0
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v2
- name: install ${{ matrix.toolchain }} toolchain
id: install_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- run: rustup component add rustfmt
if: matrix.toolchain == 'nightly' && matrix.os == 'ubuntu-latest'
- run: cargo +nightly fmt --all -- --check
if: matrix.toolchain == 'nightly' && matrix.os == 'ubuntu-latest'
- run: rustup component add clippy
if: matrix.toolchain == 'nightly'
- run: cargo +nightly clippy -Z unstable-options --workspace --all-features
if: matrix.toolchain == 'nightly'
- run: cargo test --workspace --all-features
- uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
- env:
LINKCHECK_URL: https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.0/mdbook-linkcheck-v0.7.0-x86_64-unknown-linux-gnu.tar.gz
run: curl -L ${{ env.LINKCHECK_URL }} | tar -C ~/.cargo/bin -xzf -
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
- run: mdbook build book
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
- run: mdbook test -L ./target/debug/deps book
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'