Skip to content

Commit

Permalink
Re-enable sccache (denoland#9670)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 3, 2021
1 parent 79e2e6a commit af7e021
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: sccache

steps:
- name: Configure git
Expand All @@ -71,11 +72,39 @@ jobs:
mkdir -p target/release
tar --exclude=.cargo_home --exclude=".git*" --exclude=target --exclude=third_party/prebuilt -czvf target/release/deno_src.tar.gz -C .. deno
# Note the following caches target which includes sccache.
- uses: Swatinem/rust-cache@v1

- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.50.0

- name: Install and start sccache
shell: pwsh
env:
SCCACHE_DIR: ${{ github.workspace }}/target/sccache
SCCACHE_CACHE_SIZE: 128M
SCCACHE_IDLE_TIMEOUT: 0
run: |
$version = "v0.2.15"
$platform =
@{ "macOS" = "x86_64-apple-darwin"
"Linux" = "x86_64-unknown-linux-musl"
"Windows" = "x86_64-pc-windows-msvc"
}.${{ runner.os }}
$basename = "sccache-$version-$platform"
chmod u+x $basename/sccache
$url = "https://github.com/mozilla/sccache/releases/download/" +
"$version/$basename.tar.gz"
cd ~
curl -LO $url
tar -xzvf "$basename.tar.gz"
chmod u+x $basename/sccache
. $basename/sccache --start-server
echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install clippy and rustfmt
if: matrix.kind == 'lint'
run: |
Expand Down Expand Up @@ -330,3 +359,7 @@ jobs:
target/release/deno_src.tar.gz
target/release/lib.deno.d.ts
draft: true

- name: Stop sccache
if: always()
run: sccache --stop-server

0 comments on commit af7e021

Please sign in to comment.