Skip to content

Commit

Permalink
chore(ci): enable sccache for integration tests (#9597)
Browse files Browse the repository at this point in the history
### Description

Enable sccache for building the turbo binary in integration tests.

### Testing Instructions

This should provide a speedup for our integration tests:
- [Normal
run](https://github.com/vercel/turborepo/actions/runs/12209798573?pr=9545):
   - Ubuntu: 12m 17s
   - macOs: 25m 45s
   - Windows: 26m 13s
- [Run with
sccache](https://github.com/vercel/turborepo/actions/runs/12245380679?pr=9597)
   - Ubuntu: 7m 8s 
   - macOs: 18m 44s 
   - Windows:  23m 31s 

(I quick double checked that none of these were `turbo` cached, but they
did have a warmed `sccache` so external dep changes will degrade speed)
  • Loading branch information
chris-olszewski authored Dec 10, 2024
1 parent 5e04226 commit 11b6c37
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/turborepo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,24 @@ jobs:
path: cli/.cram_env
key: prysk-venv-${{ matrix.os.runner }}

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Integration Tests
run: turbo run test --filter=turborepo-tests-integration --color --env-mode=strict --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }}
run: |
if [ -z "${RUSTC_WRAPPER}" ]; then
unset RUSTC_WRAPPER
fi
turbo run test --filter=turborepo-tests-integration --color --env-mode=strict --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }}
shell: bash
env:
SCCACHE_BUCKET: turborepo-sccache
SCCACHE_REGION: us-east-2
# Only use sccache if we're in the Vercel repo.
RUSTC_WRAPPER: ${{ !github.event.pull_request.head.repo.fork && 'sccache' || '' }}
CARGO_INCREMENTAL: 0
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

examples:
name: Turborepo Examples
Expand Down
9 changes: 8 additions & 1 deletion cli/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
"rust-src"
],
"passThroughEnv": [
"ProgramData"
"ProgramData",
// sccache related flags
"SCCACHE_BUCKET",
"SCCACHE_REGION",
"RUSTC_WRAPPER",
"CARGO_INCREMENTAL",
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/turbo-trace/src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub enum TraceError {
}

impl TraceResult {
#[allow(dead_code)]
pub fn emit_errors(&self) {
let handler = Handler::with_tty_emitter(
ColorConfig::Auto,
Expand Down

0 comments on commit 11b6c37

Please sign in to comment.