Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Use sccache to speed up compilation #1445

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,23 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- name: Configure sccache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run tests
run: >
cargo test
--release
--workspace
${{ steps.prepare.outputs.feature-flags }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: Run slow tests
run: >
cargo test
Expand All @@ -74,6 +85,9 @@ jobs:
${{ steps.prepare.outputs.feature-flags }}
--features expensive-tests
-- --ignored
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: Verify working directory is clean
run: git diff --exit-code

Expand Down Expand Up @@ -124,13 +138,24 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- name: Configure sccache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run check
run: >
cargo check
--release
--workspace
--tests
${{ steps.prepare.outputs.feature-flags }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: Verify working directory is clean
run: git diff --exit-code

Expand All @@ -153,6 +178,14 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-latest
- name: Configure sccache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- uses: dtolnay/rust-toolchain@stable
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
Expand All @@ -165,6 +198,9 @@ jobs:
--all-targets
${{ steps.prepare.outputs.feature-flags }}
--verbose
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: Verify working directory is clean (excluding lockfile)
run: git diff --exit-code ':!Cargo.lock'

Expand Down Expand Up @@ -275,6 +311,14 @@ jobs:
~/.cargo/git/db/
target/
key: codecov-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Configure sccache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Generate coverage report
run: >
cargo tarpaulin
Expand All @@ -283,6 +327,9 @@ jobs:
--release
--timeout 600
--out xml
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down
Loading