24
24
- run : rustup update stable && rustup default stable
25
25
- run : rustup component add rustfmt
26
26
- run : cargo fmt --all --check
27
- - run : |
28
- for manifest in `find crates benches/benchsuite benches/capture -name Cargo.toml`
29
- do
30
- echo check fmt for $manifest
31
- cargo fmt --all --manifest-path $manifest --check
32
- done
33
27
34
28
# Ensure there are no clippy warnings
35
29
clippy :
39
33
- run : rustup update stable && rustup default stable
40
34
- run : rustup component add clippy
41
35
# Only check cargo lib for now
42
- - run : cargo clippy -p cargo --lib -- -D warnings
36
+ # TODO: check every members
37
+ - run : cargo clippy -p cargo --lib --no-deps -- -D warnings
38
+
39
+ stale-label :
40
+ runs-on : ubuntu-latest
41
+ steps :
42
+ - uses : actions/checkout@v3
43
+ - run : rustup update stable && rustup default stable
44
+ - run : cargo stale-label
45
+
46
+ # Ensure Cargo.lock is up-to-date
47
+ lockfile :
48
+ runs-on : ubuntu-latest
49
+ steps :
50
+ - uses : actions/checkout@v3
51
+ - run : rustup update stable && rustup default stable
52
+ - run : cargo update -p cargo --locked
43
53
44
54
test :
45
55
runs-on : ${{ matrix.os }}
@@ -101,47 +111,39 @@ jobs:
101
111
run : echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV
102
112
if : matrix.os == 'ubuntu-latest'
103
113
104
- - run : cargo test
114
+ - run : cargo test -p cargo
105
115
- name : Clear intermediate test output
106
116
run : ci/clean-test-output.sh
107
117
- name : gitoxide tests (all git-related tests)
108
- run : cargo test git
118
+ run : cargo test -p cargo git
109
119
env :
110
120
__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1
111
121
# The testsuite generates a huge amount of data, and fetch-smoke-test was
112
122
# running out of disk space.
113
123
- name : Clear test output
114
124
run : ci/clean-test-output.sh
125
+ # This only tests `cargo fix` because fix-proxy-mode is one of the most
126
+ # complicated subprocess management in Cargo.
115
127
- name : Check operability of rustc invocation with argfile
128
+ run : ' cargo test -p cargo --test testsuite -- fix::'
116
129
env :
117
130
__CARGO_TEST_FORCE_ARGFILE : 1
118
- run : |
119
- # This only tests `cargo fix` because fix-proxy-mode is one of the most
120
- # complicated subprocess management in Cargo.
121
- cargo test --test testsuite -- fix::
122
- - run : cargo test --manifest-path crates/cargo-test-support/Cargo.toml
123
- env :
124
- CARGO_TARGET_DIR : target
131
+ - run : cargo test -p cargo-test-support
125
132
- run : cargo test -p cargo-platform
126
133
- run : cargo test -p cargo-util
127
- - run : cargo test --manifest-path crates/home/Cargo.toml
128
- - run : cargo test --manifest-path crates/mdman/Cargo.toml
129
- - run : cargo build --manifest-path crates/credential/cargo-credential-1password/Cargo.toml
130
- - run : cargo build --manifest-path crates/credential/cargo-credential-gnome-secret/Cargo.toml
134
+ - run : cargo test -p home
135
+ - run : cargo test -p mdman
136
+ - run : cargo build -p cargo-credential-1password
137
+ - run : cargo build -p cargo-credential-macos-keychain
138
+ - run : cargo build -p cargo-credential-wincred
139
+ - run : cargo build -p cargo-credential-gnome-secret
131
140
if : matrix.os == 'ubuntu-latest'
132
- - run : cargo build --manifest-path crates/credential/cargo-credential-macos-keychain/Cargo.toml
133
- if : matrix.os == 'macos-latest'
134
- - run : cargo build --manifest-path crates/credential/cargo-credential-wincred/Cargo.toml
135
- if : matrix.os == 'windows-latest'
136
141
- name : Check benchmarks
137
- env :
138
- # Share the target dir to try to cache a few build-time deps.
139
- CARGO_TARGET_DIR : target
140
142
run : |
141
143
# This only tests one benchmark since it can take over 10 minutes to
142
144
# download all workspaces.
143
- cargo test --manifest-path benches/ benchsuite/Cargo.toml --all-targets -- cargo
144
- cargo check --manifest-path benches/ capture/Cargo.toml
145
+ cargo test -p benchsuite --all-targets -- cargo
146
+ cargo check -p capture
145
147
# The testsuite generates a huge amount of data, and fetch-smoke-test was
146
148
# running out of disk space.
147
149
- name : Clear benchmark output
@@ -154,7 +156,7 @@ jobs:
154
156
steps :
155
157
- uses : actions/checkout@v3
156
158
- run : rustup update stable && rustup default stable
157
- - run : cargo test --manifest-path crates/ resolver-tests/Cargo.toml
159
+ - run : cargo test -p resolver-tests
158
160
159
161
test_gitoxide :
160
162
runs-on : ubuntu-latest
@@ -164,7 +166,7 @@ jobs:
164
166
- run : rustup target add i686-unknown-linux-gnu
165
167
- run : sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
166
168
- run : rustup component add rustfmt || echo "rustfmt not available"
167
- - run : cargo test
169
+ - run : cargo test -p cargo
168
170
env :
169
171
__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1
170
172
@@ -175,7 +177,7 @@ jobs:
175
177
- run : rustup update nightly && rustup default nightly
176
178
- run : rustup component add rust-src
177
179
- run : cargo build
178
- - run : cargo test --test build-std
180
+ - run : cargo test -p cargo - -test build-std
179
181
env :
180
182
CARGO_RUN_BUILD_STD_TESTS : 1
181
183
docs :
@@ -187,26 +189,36 @@ jobs:
187
189
- run : rustup component add rust-docs
188
190
- run : ci/validate-man.sh
189
191
# This requires rustfmt, use stable.
190
- - run : cd src/doc/semver-check && cargo +stable run
191
- - run : |
192
+ - name : Run semver-check
193
+ run : cargo +stable run -p semver-check
194
+ - name : Ensure intradoc links are valid
195
+ run : cargo doc --workspace --document-private-items --no-deps
196
+ env :
197
+ RUSTDOCFLAGS : -D warnings
198
+ - name : Install mdbook
199
+ run : |
192
200
mkdir mdbook
193
201
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
194
202
echo `pwd`/mdbook >> $GITHUB_PATH
195
- - run : cargo doc --document-private-items --no-deps
196
- env :
197
- RUSTDOCFLAGS : -D warnings
198
203
- run : cd src/doc && mdbook build --dest-dir ../../target/doc
199
- - run : |
200
- cd src/doc
201
- curl -sSLo linkcheck.sh \
202
- https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
203
- sh linkcheck.sh --all cargo
204
+ - name : Run linkchecker.sh
205
+ run : |
206
+ cd target
207
+ curl -sSLO https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
208
+ sh linkcheck.sh --all --path ../src/doc cargo
204
209
205
210
success :
206
211
permissions :
207
212
contents : none
208
213
name : bors build finished
209
- needs : [docs, rustfmt, test, resolver, build_std, test_gitoxide]
214
+ needs :
215
+ - build_std
216
+ - docs
217
+ - lockfile
218
+ - resolver
219
+ - rustfmt
220
+ - test
221
+ - test_gitoxide
210
222
runs-on : ubuntu-latest
211
223
if : " success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
212
224
steps :
@@ -215,7 +227,14 @@ jobs:
215
227
permissions :
216
228
contents : none
217
229
name : bors build finished
218
- needs : [docs, rustfmt, test, resolver, build_std]
230
+ needs :
231
+ - build_std
232
+ - docs
233
+ - lockfile
234
+ - resolver
235
+ - rustfmt
236
+ - test
237
+ - test_gitoxide
219
238
runs-on : ubuntu-latest
220
239
if : " !success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
221
240
steps :
0 commit comments