4
4
push :
5
5
branches :
6
6
- main
7
+ tags :
8
+ - " v*"
7
9
pull_request :
8
10
branches :
9
11
- main
10
12
schedule :
11
- - cron : ' 00 01 * * *'
13
+ - cron : " 00 01 * * *"
12
14
13
15
# Stops the running workflow of previous pushes
14
16
concurrency :
@@ -22,33 +24,25 @@ jobs:
22
24
name : Rustfmt & Clippy lints
23
25
24
26
runs-on : ubuntu-latest
25
- strategy :
26
- fail-fast : false
27
+ # strategy:
28
+ # fail-fast: false
27
29
env :
28
30
RUSTUP_MAX_RETRIES : 10
29
31
CARGO_NET_RETRY : 10
30
32
steps :
31
33
- uses : actions/checkout@v3
32
34
35
+ # use nightly for rustfmt & clippy checks
33
36
- name : Install Rust nightly toolchain
34
- uses : actions-rs/ toolchain@v1
37
+ uses : dtolnay/rust- toolchain@nightly
35
38
with :
36
- toolchain : nightly
37
- profile : default
38
- override : true
39
39
components : rustfmt, clippy
40
40
41
41
- name : Rust format
42
- uses : actions-rs/cargo@v1
43
- with :
44
- command : fmt
45
- args : --check
42
+ run : cargo fmt --check
46
43
47
44
- name : Clippy lints
48
- uses : actions-rs/cargo@v1
49
- with :
50
- command : clippy
51
- args : --no-deps -- -D warnings
45
+ run : cargo clippy --no-deps -- -D warnings
52
46
test :
53
47
name : Test
54
48
@@ -65,50 +59,26 @@ jobs:
65
59
steps :
66
60
- uses : actions/checkout@v3
67
61
68
- # We need to disable the existing toolchain to avoid updating rust-docs
69
- # which takes a long time. The fastest way to do this is to rename the
70
- # existing folder, as deleting it takes about as much time as not doing
71
- # anything and just updating rust-docs.
72
- - name : Rename existing rust toolchain (Windows)
73
- if : matrix.os == 'windows-latest'
74
- run : Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
75
-
76
62
- name : Install Rust toolchain
77
- uses : actions-rs/ toolchain@v1
63
+ uses : dtolnay/rust- toolchain@stable
78
64
with :
79
- toolchain : ${{ matrix.rust }}
80
- profile : minimal
81
- override : true
82
65
components : rust-src
66
+ toolchain : ${{ matrix.rust }}
83
67
84
68
- name : Build
85
- uses : actions-rs/cargo@v1
86
- with :
87
- command : build
69
+ run : cargo build
88
70
89
71
- name : Test --no-default-features
90
- uses : actions-rs/cargo@v1
91
- with :
92
- command : test
93
- args : --no-default-features
72
+ run : cargo test --no-default-features
94
73
95
74
- name : Test --all-features
96
- uses : actions-rs/cargo@v1
97
- with :
98
- command : test
99
- args : --all-features
75
+ run : cargo test --all-features
100
76
101
77
- name : Test (Release)
102
- uses : actions-rs/cargo@v1
103
- with :
104
- command : test
105
- args : --release --no-default-features
106
-
78
+ run : cargo test --release --no-default-features
79
+
107
80
- name : Test (Release) all-features
108
- uses : actions-rs/cargo@v1
109
- with :
110
- command : test
111
- args : --release --all-features
81
+ run : cargo test --release --all-features
112
82
113
83
# Detect cases where documentation links don't resolve and such.
114
84
doc :
@@ -118,37 +88,31 @@ jobs:
118
88
RUSTDOCFLAGS : " -D warnings"
119
89
steps :
120
90
- uses : actions/checkout@v3
121
- - uses : actions-rs/toolchain@v1
91
+ # Docs.rs uses nightly, which allows for easier syntax for linking to functions.
92
+ - uses : dtolnay/rust-toolchain@nightly
122
93
with :
123
- profile : minimal
124
- # Docs.rs uses nightly, which allows for easier syntax for linking to functions.
125
- toolchain : nightly
126
- override : true
94
+ components : rust-docs
127
95
128
96
- name : Docs --all-features
129
- uses : actions-rs/cargo@v1
130
- with :
131
- command : doc
132
- args : --all-features --no-deps
97
+ run : cargo doc --all-features --no-deps
133
98
134
99
- name : Docs --no-default-features
135
- uses : actions-rs/cargo@v1
136
- with :
137
- command : doc
138
- args : --no-default-features --no-deps
139
-
100
+ run : cargo doc --no-default-features --no-deps
140
101
codecov :
141
102
name : Generate code coverage
142
103
runs-on : ubuntu-latest
104
+ container :
105
+ image : xd009642/tarpaulin:develop-nightly
106
+ options : --security-opt seccomp=unconfined
143
107
steps :
144
- - uses : actions/checkout@v3
145
- - uses : actions-rs/toolchain@v1
146
- with :
147
- toolchain : stable
148
- override : true
108
+ - name : Checkout repository
109
+ uses : actions/checkout@v3
149
110
150
- - name : Run cargo-tarpaulin
151
- uses : actions-rs/tarpaulin@v0.1
111
+ - name : Generate code coverage
112
+ run : |
113
+ cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
152
114
153
115
- name : Upload to codecov.io
154
- uses : codecov/codecov-action@v1
116
+ uses : codecov/codecov-action@v2
117
+ with :
118
+ fail_ci_if_error : true
0 commit comments