From 460d48437b3e3a625a8443a6afc2d5319d0da565 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 4 Sep 2024 14:12:07 +0300 Subject: [PATCH] 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. --- .github/workflows/build_and_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 53d33b420f..e50fbedfad 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -122,9 +122,11 @@ 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 ] + arch: [ x64 ] runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }} container: @@ -168,8 +170,6 @@ jobs: 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 - name: Check documentation generation run: cargo doc --workspace --no-deps --document-private-items