-
Notifications
You must be signed in to change notification settings - Fork 17
91 lines (71 loc) · 2.18 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check:
runs-on: ubuntu-22.04
strategy:
matrix:
toolchain:
- stable
# minimum version: because of "clap_lex"
- "1.70"
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
run: |
rustup toolchain install ${{ matrix.toolchain }} --component rustfmt,clippy --target wasm32-unknown-unknown
rustup default ${{ matrix.toolchain }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
- name: Run cargo fmt
run: |
cargo fmt --all -- --check
- name: Install binstall
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install cargo-all-features
run: |
cargo binstall -y cargo-all-features
- name: Run cargo check
run: |
cargo check-all-features --target wasm32-unknown-unknown
- name: Run cargo test
run: |
cargo test-all-features
- name: Run cargo clippy
run: |
cargo clippy --target wasm32-unknown-unknown -- -D warnings
examples:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-examples-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
- name: Check (yew-oauth2-example)
run: |
cd yew-oauth2-example
cargo check
cargo check --features openid
- name: Check (yew-oauth2-redirect-example)
run: |
cd yew-oauth2-redirect-example
cargo check
cargo check --features openid