Skip to content

Commit

Permalink
add sccache
Browse files Browse the repository at this point in the history
  • Loading branch information
georglauterbach committed Jan 15, 2024
1 parent a42ade3 commit 9aaf3fe
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/code_tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on: # yamllint disable-line rule:truthy

defaults:
run:
shell: bash
working-directory: code

jobs:
Expand All @@ -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/[email protected]

- 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
Expand All @@ -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/[email protected]

- 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

0 comments on commit 9aaf3fe

Please sign in to comment.