1
+ name : check
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
10
+ workflow_dispatch : {}
11
+
12
+ jobs :
13
+ clippy :
14
+ name : Clippy
15
+ runs-on : ubuntu-latest
16
+
17
+ strategy :
18
+ matrix :
19
+ rust : [stable, beta, nightly]
20
+
21
+ steps :
22
+ - name : Checkout
23
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
24
+
25
+ - name : Install rust (${{ matrix.rust }})
26
+ uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
27
+ with :
28
+ components : clippy, rustfmt
29
+ toolchain : ${{ matrix.rust }}
30
+
31
+ - name : Run clippy
32
+ run : cargo clippy --all-features -- -D warnings
33
+
34
+ fmt :
35
+ name : Formatting
36
+ runs-on : ubuntu-latest
37
+
38
+ steps :
39
+ - name : Checkout
40
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
41
+
42
+ - name : Install rust (stable)
43
+ uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
44
+ with :
45
+ components : clippy, rustfmt
46
+ toolchain : stable
47
+
48
+ - name : Run rustfmt
49
+ run : cargo fmt --check
50
+
51
+ build_and_test :
52
+ name : Build and test
53
+ runs-on : ${{ matrix.os }}-latest
54
+
55
+ strategy :
56
+ matrix :
57
+ os : [ubuntu, macos, windows]
58
+ rust : [stable, beta, nightly]
59
+
60
+ steps :
61
+ - name : Checkout
62
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
63
+
64
+ - name : Install rust (${{ matrix.rust }})
65
+ uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
66
+ with :
67
+ toolchain : ${{ matrix.rust }}
68
+
69
+ - name : Cache
70
+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
71
+ with :
72
+ path : |
73
+ ~/.cargo
74
+ target
75
+ key : ${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
76
+ restore-keys : |
77
+ ${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
78
+ ${{ matrix.os }}-${{ matrix.rust }}-
79
+
80
+ - name : Build
81
+ run : cargo build --all-targets
82
+
83
+ - name : Tests
84
+ run : cargo test
85
+
86
+ msrv :
87
+ name : Check minimal supported rust version (MSRV).
88
+ runs-on : ubuntu-latest
89
+
90
+ steps :
91
+ - name : Checkout
92
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
93
+
94
+ - name : Install rust (stable)
95
+ uses : dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
96
+ with :
97
+ toolchain : stable
98
+
99
+ - name : Cache
100
+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
101
+ with :
102
+ path : |
103
+ ~/.cargo
104
+ target
105
+ key : ${{ runner.os }}-msrv
106
+
107
+ - name : Install cargo-msrv
108
+ run : cargo install cargo-msrv
109
+
110
+ - name : Check msrv
111
+ run : cargo msrv
0 commit comments