-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (114 loc) · 3.2 KB
/
validation-rust.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
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
---
# Main "useful" actions config file
# Cache config comes from https://github.com/actions/cache/blob/main/examples.md#rust---cargo
on:
push:
branches:
- main
pull_request:
name: Rust Validation
env:
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
clippy:
name: "Clippy (cargo clippy)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo clippy --no-default-features --all-targets -- -D warnings
test:
strategy:
fail-fast: true
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
extension: ''
# - build: macos
# os: macos-latest
# target: x86_64-apple-darwin
# extension: ''
- build: windows-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
name: "Test on ${{ matrix.os }} (cargo test)"
runs-on: ${{ matrix.os }}
env:
MYSQLCLIENT_LIB_DIR: C:\mysql\lib
steps:
- uses: actions/checkout@v2
- name: List files
run: |
pwd
ls
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/[email protected]
- run: cargo test -- --nocapture
fmt:
name: "Format (cargo fmt)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
- uses: actions/setup-python@v3
doc:
name: "Docs (cargo doc)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
- run: cargo doc
outdated:
name: Outdated
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exit-code 1