-
Notifications
You must be signed in to change notification settings - Fork 12
108 lines (106 loc) · 4.46 KB
/
rust.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
name: tests
on:
push: { branches: ["main"] }
pull_request: { branches: ["*"] }
jobs:
build_and_test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --all-targets --color=always
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets --color=always
- name: Build (with unix feature)
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --all-targets --color=always --features unix
- name: Test (with unix feature)
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets --color=always --features unix
- name: Clippy
uses: actions-rs-plus/[email protected]
with:
args: --workspace --all-targets
check_configurations:
name: Check codebase
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
strategy:
matrix:
target:
- "x86_64-unknown-linux-gnu"
- "aarch64-unknown-linux-gnu"
- "x86_64-pc-windows-msvc"
- "x86_64-apple-darwin"
- "x86_64-unknown-freebsd"
- "x86_64-unknown-netbsd"
steps:
- name: Checkout code
uses: actions/checkout@master
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.target }}
- name: Install toolchain
run: rustup target add ${{ matrix.target }}
- name: Check (no features)
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} ${{ matrix.with-doc }} ${{ matrix.with-rs4xx }} ${{ matrix.with-unix }} ${{ matrix.with-windows }}
cargo doc --workspace --color=always --target ${{ matrix.target }} ${{ matrix.with-doc }} ${{ matrix.with-rs4xx }} ${{ matrix.with-unix }} ${{ matrix.with-windows }}
- name: Check --features doc
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features doc
cargo doc --workspace --color=always --target ${{ matrix.target }} --features doc
- name: Check --features unix
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features unix
cargo doc --workspace --color=always --target ${{ matrix.target }} --features unix
- name: Check --features windows
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features windows
cargo doc --workspace --color=always --target ${{ matrix.target }} --features windows
- name: Check --features rs4xx
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features rs4xx
cargo doc --workspace --color=always --target ${{ matrix.target }} --features rs4xx
- name: Check --features unix,windows
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features unix,windows
cargo doc --workspace --color=always --target ${{ matrix.target }} --features unix,windows
- name: Check --features unix,rs4xx
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features unix,rs4xx
cargo doc --workspace --color=always --target ${{ matrix.target }} --features unix,rs4xx
- name: Check --features windows,rs4xx
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features windows,rs4xx
cargo doc --workspace --color=always --target ${{ matrix.target }} --features windows,rs4xx
- name: Check --features unix,windows,rs4xx
run: |
cargo clippy --workspace --color=always --target ${{ matrix.target }} --features unix,windows,rs4xx
cargo doc --workspace --color=always --target ${{ matrix.target }} --features unix,windows,rs4xx