From 9aaf3fedfe2aa2f7343174ec14977c89cffcc378 Mon Sep 17 00:00:00 2001 From: georglauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Mon, 15 Jan 2024 12:02:52 +0100 Subject: [PATCH] add sccache --- .github/workflows/code_tests_and_checks.yml | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/code_tests_and_checks.yml b/.github/workflows/code_tests_and_checks.yml index 760eca5..3cef7bd 100644 --- a/.github/workflows/code_tests_and_checks.yml +++ b/.github/workflows/code_tests_and_checks.yml @@ -14,6 +14,7 @@ on: # yamllint disable-line rule:truthy defaults: run: + shell: bash working-directory: code jobs: @@ -27,7 +28,23 @@ jobs: - name: Install Rust run: ../misc/scripts/install_rust.sh + - name: Run sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.3 + + - name: Set Rust caching env vars only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo 'SCCACHE_GHA_ENABLED=true' >>"${GITHUB_ENV}" + echo 'RUSTC_WRAPPER=sccache' >>"${GITHUB_ENV}" + + - name: Run sccache stat for check + run: ${SCCACHE_PATH} --show-stats + - name: Run all checks + env: + SCCACHE_GHA_ENABLED: 'true' + RUSTC_WRAPPER: sccache run: >- cargo run -- -vv check @@ -46,10 +63,29 @@ jobs: - name: Install Rust run: ../misc/scripts/install_rust.sh + - name: Run sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.3 + + - name: Set Rust caching env vars only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo 'SCCACHE_GHA_ENABLED=true' >>"${GITHUB_ENV}" + echo 'RUSTC_WRAPPER=sccache' >>"${GITHUB_ENV}" + + - name: Run sccache stat for check + run: ${SCCACHE_PATH} --show-stats + - name: Run all unit-test + env: + SCCACHE_GHA_ENABLED: 'true' + RUSTC_WRAPPER: sccache run: >- cargo run -- -vv u-test - name: Run all integration-tests + env: + SCCACHE_GHA_ENABLED: 'true' + RUSTC_WRAPPER: sccache run: >- cargo run -- -vv i-test