2424 - run : rustup update stable && rustup default stable
2525 - run : rustup component add rustfmt
2626 - 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
3327
3428 # Ensure there are no clippy warnings
3529 clippy :
3933 - run : rustup update stable && rustup default stable
4034 - run : rustup component add clippy
4135 # 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
4353
4454 test :
4555 runs-on : ${{ matrix.os }}
@@ -101,47 +111,39 @@ jobs:
101111 run : echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV
102112 if : matrix.os == 'ubuntu-latest'
103113
104- - run : cargo test
114+ - run : cargo test -p cargo
105115 - name : Clear intermediate test output
106116 run : ci/clean-test-output.sh
107117 - name : gitoxide tests (all git-related tests)
108- run : cargo test git
118+ run : cargo test -p cargo git
109119 env :
110120 __CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1
111121 # The testsuite generates a huge amount of data, and fetch-smoke-test was
112122 # running out of disk space.
113123 - name : Clear test output
114124 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.
115127 - name : Check operability of rustc invocation with argfile
128+ run : ' cargo test -p cargo --test testsuite -- fix::'
116129 env :
117130 __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
125132 - run : cargo test -p cargo-platform
126133 - 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
131140 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'
136141 - name : Check benchmarks
137- env :
138- # Share the target dir to try to cache a few build-time deps.
139- CARGO_TARGET_DIR : target
140142 run : |
141143 # This only tests one benchmark since it can take over 10 minutes to
142144 # 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
145147 # The testsuite generates a huge amount of data, and fetch-smoke-test was
146148 # running out of disk space.
147149 - name : Clear benchmark output
@@ -154,7 +156,7 @@ jobs:
154156 steps :
155157 - uses : actions/checkout@v3
156158 - 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
158160
159161 test_gitoxide :
160162 runs-on : ubuntu-latest
@@ -164,7 +166,7 @@ jobs:
164166 - run : rustup target add i686-unknown-linux-gnu
165167 - run : sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
166168 - run : rustup component add rustfmt || echo "rustfmt not available"
167- - run : cargo test
169+ - run : cargo test -p cargo
168170 env :
169171 __CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1
170172
@@ -175,7 +177,7 @@ jobs:
175177 - run : rustup update nightly && rustup default nightly
176178 - run : rustup component add rust-src
177179 - run : cargo build
178- - run : cargo test --test build-std
180+ - run : cargo test -p cargo - -test build-std
179181 env :
180182 CARGO_RUN_BUILD_STD_TESTS : 1
181183 docs :
@@ -187,26 +189,36 @@ jobs:
187189 - run : rustup component add rust-docs
188190 - run : ci/validate-man.sh
189191 # 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 : |
192200 mkdir mdbook
193201 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
194202 echo `pwd`/mdbook >> $GITHUB_PATH
195- - run : cargo doc --document-private-items --no-deps
196- env :
197- RUSTDOCFLAGS : -D warnings
198203 - 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
204209
205210 success :
206211 permissions :
207212 contents : none
208213 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
210222 runs-on : ubuntu-latest
211223 if : " success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
212224 steps :
@@ -215,7 +227,14 @@ jobs:
215227 permissions :
216228 contents : none
217229 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
219238 runs-on : ubuntu-latest
220239 if : " !success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
221240 steps :
0 commit comments