Compare commits

...

9 Commits

Author SHA1 Message Date
Alexander Bayandin
ae50e9600f Try to find the best parallelisation 2024-09-14 12:19:11 +01:00
Alexander Bayandin
cd613f5ab3 CI(check-codestyle-rust): use parallel and cargo hack --partition 2024-09-05 13:35:12 +01:00
Alexander Bayandin
539b3ad541 Revert "CI(check-codestyle-rust): use mold -run"
This reverts commit a0e923b70b.
2024-09-05 11:31:01 +01:00
Alexander Bayandin
79fa640058 Revert "CI(check-codestyle-rust): try to use -j$(nproc)"
This reverts commit c41f9870a5.
2024-09-05 11:30:21 +01:00
Alexander Bayandin
c41f9870a5 CI(check-codestyle-rust): try to use -j$(nproc) 2024-09-05 00:18:35 +01:00
Alexander Bayandin
a0e923b70b CI(check-codestyle-rust): use mold -run 2024-09-04 23:58:25 +01:00
Alexander Bayandin
38f6107534 CI(check-codestyle-rust): revert back arm64 & use large runners 2024-09-04 22:48:44 +01:00
Alexander Bayandin
f25e07893c CI(check-codestyle-rust): use -C debug-assertions=off instead of --release 2024-09-04 15:22:55 +01:00
Heikki Linnakangas
460d48437b Run fewer redundant rust formatting checks
We have no ARM64 or x64 specific code currently, so there's not much
need to run clippy and other rust codestyle checks on both
architectures. The check-codestyle-rust job took about 40 minutes on
arm64 in the CI, which is now avoided.

Also, skip running clippy in --release mode. It's pretty expensive to
run, and there is very little difference between debug and release
builds that could lead to different clippy warnings. The debug and
release clippy checks took about 6 minutes each, so this saves another
6 minutes of runtime on CI.

This doesn't make the overall CI runtime shorter, because other jobs
still take longer than thesee did. But the 40 minutes spent on arm64
was actually pretty close to being the slowest job, and spending less
on these tests is good anyway.
2024-09-04 14:12:07 +03:00

View File

@@ -122,10 +122,12 @@ jobs:
check-codestyle-rust:
needs: [ check-permissions, build-build-tools-image ]
# There's no reason to expect clippy or code formatting to be different on different platforms,
# so it's enough to run these on x64 only.
strategy:
matrix:
arch: [ x64, arm64 ]
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
container:
image: ${{ needs.build-build-tools-image.outputs.image }}
@@ -166,15 +168,25 @@ jobs:
exit 1
fi
echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
- name: Run cargo clippy (debug)
run: cargo hack --feature-powerset clippy $CLIPPY_COMMON_ARGS
- name: Run cargo clippy (release)
run: cargo hack --feature-powerset clippy --release $CLIPPY_COMMON_ARGS
run: |
parallel --jobs 8 "cargo hack --feature-powerset --partition {}/8 clippy --target-dir target/partition-{} $CLIPPY_COMMON_ARGS" ::: 1 2 3 4 5 6 7 8
# instead of running the full release build, running debug build again,
# but with disabled `debug-assertions` to excersice release code paths
- name: Run cargo clippy (debug, with debug-assertions=false)
run: |
for N in 4 8 10 12 14 16 18 20; do
echo "Running clippy with debug-assertions=false for partition ${N}"
time parallel --jobs ${N} "cargo hack --feature-powerset --partition {}/${N} clippy --target-dir target/partition-{} $CLIPPY_COMMON_ARGS -C debug-assertions=off" ::: $(seq -s " " 1 ${N})
rm -rf target/partition-*
done
- name: Check documentation generation
run: cargo doc --workspace --no-deps --document-private-items
env:
RUSTDOCFLAGS: "-Dwarnings -Arustdoc::private_intra_doc_links"
RUSTDOCFLAGS: "-Dwarnings -Arustdoc::private_intra_doc_links"
# Use `${{ !cancelled() }}` to run quck tests after the longer clippy run
- name: Check formatting