1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 04:48:52 -05:00

ci: Remove sccache, use better cargo cache (#9687)

This commit is contained in:
Ryan Dahl 2021-03-09 14:15:23 -05:00 committed by GitHub
parent cdc0b6958d
commit ff96c95bbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ jobs:
github.event_name == 'push' || github.event_name == 'push' ||
!startsWith(github.event.pull_request.head.label, 'denoland:') !startsWith(github.event.pull_request.head.label, 'denoland:')
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 60 timeout-minutes: 90
strategy: strategy:
matrix: matrix:
include: include:
@ -47,7 +47,6 @@ jobs:
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full RUST_BACKTRACE: full
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
RUSTC_WRAPPER: sccache
steps: steps:
- name: Configure git - name: Configure git
@ -62,6 +61,18 @@ jobs:
fetch-depth: 5 fetch-depth: 5
submodules: true submodules: true
# Install gnu-tar because BSD tar is buggy on Github's macos machines.
# https://github.com/actions/cache/issues/403
# https://github.com/actions-rs/cargo/issues/111.
- name: Install GNU tar
if: matrix.build == 'macos'
run: |
brew install gnu-tar
echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
- name: Write git_submodule_status.txt
run: git submodule status --recursive > git_submodule_status.txt
- name: Create source tarballs (release, linux) - name: Create source tarballs (release, linux)
if: | if: |
startsWith(matrix.os, 'ubuntu') && startsWith(matrix.os, 'ubuntu') &&
@ -72,39 +83,24 @@ jobs:
mkdir -p target/release 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 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. - name: Cargo Cache
- uses: Swatinem/rust-cache@v1 uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
.cargo_home
target/*/.*
target/*/build
target/*/deps
key: cargo-cache-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-cache-${{ runner.os }}-
- name: Install rust - name: Install rust
uses: hecrj/setup-rust-action@v1 uses: hecrj/setup-rust-action@v1
with: with:
rust-version: 1.50.0 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 - name: Install clippy and rustfmt
if: matrix.kind == 'lint' if: matrix.kind == 'lint'
run: | run: |
@ -359,7 +355,3 @@ jobs:
target/release/deno_src.tar.gz target/release/deno_src.tar.gz
target/release/lib.deno.d.ts target/release/lib.deno.d.ts
draft: true draft: true
- name: Stop sccache
if: always()
run: sccache --stop-server