mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
ci: setup sccache (#3403)
This commit is contained in:
parent
5c7041bd2a
commit
217594d21f
1 changed files with 32 additions and 29 deletions
61
.github/workflows/ci.yml
vendored
61
.github/workflows/ci.yml
vendored
|
|
@ -28,8 +28,8 @@ env:
|
||||||
RUSTFLAGS: "-D warnings"
|
RUSTFLAGS: "-D warnings"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cache: # Warm cache factory for all other CI jobs
|
test:
|
||||||
name: Check and Build
|
name: Test
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -38,21 +38,29 @@ jobs:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
- os: macos-14
|
- os: macos-14
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
# https://github.com/mozilla/sccache/blob/main/docs/S3.md
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
||||||
|
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
||||||
|
SCCACHE_REGION: auto
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
SCCACHE_LOCAL_RW_MODE:
|
||||||
steps:
|
steps:
|
||||||
- uses: taiki-e/checkout-action@v1
|
- uses: taiki-e/checkout-action@v1
|
||||||
|
- uses: ./.github/actions/rustup
|
||||||
- name: Install Rust Toolchain
|
|
||||||
uses: ./.github/actions/rustup
|
|
||||||
with:
|
with:
|
||||||
|
# warm cache factory for all other CI jobs
|
||||||
|
# cache `target` directory to avoid download crates
|
||||||
save-cache: ${{ github.ref_name == 'main' }}
|
save-cache: ${{ github.ref_name == 'main' }}
|
||||||
|
# cache build outputs to speed up compilation
|
||||||
- name: Cargo check
|
- uses: mozilla-actions/sccache-action@v0.0.4
|
||||||
run: cargo ck
|
if: ${{ vars.USE_SCCACHE == 'true' }}
|
||||||
|
- run: cargo ck
|
||||||
# Only need to build the test to create a warm cache on the main branch
|
- run: cargo test --no-run
|
||||||
- name: Build cache by Cargo Check and Cargo Test
|
- run: cargo test
|
||||||
if: ${{ github.ref_name == 'main' }}
|
|
||||||
run: cargo test --quiet --no-run
|
|
||||||
|
|
||||||
wasm:
|
wasm:
|
||||||
name: Check Wasm
|
name: Check Wasm
|
||||||
|
|
@ -186,25 +194,18 @@ jobs:
|
||||||
- name: Run doc
|
- name: Run doc
|
||||||
run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items
|
run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items
|
||||||
|
|
||||||
test:
|
|
||||||
name: Test
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: windows-latest
|
|
||||||
- os: ubuntu-latest
|
|
||||||
- os: macos-14
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: taiki-e/checkout-action@v1
|
|
||||||
- name: Install Rust
|
|
||||||
uses: ./.github/actions/rustup
|
|
||||||
- run: cargo test --quiet
|
|
||||||
|
|
||||||
conformance:
|
conformance:
|
||||||
name: Conformance
|
name: Conformance
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
# https://github.com/mozilla/sccache/blob/main/docs/S3.md
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
|
||||||
|
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
|
||||||
|
SCCACHE_REGION: auto
|
||||||
|
RUSTC_WRAPPER: sccache
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
steps:
|
steps:
|
||||||
- uses: taiki-e/checkout-action@v1
|
- uses: taiki-e/checkout-action@v1
|
||||||
|
|
||||||
|
|
@ -222,6 +223,8 @@ jobs:
|
||||||
shared-key: 'conformance'
|
shared-key: 'conformance'
|
||||||
save-cache: ${{ github.ref_name == 'main' }}
|
save-cache: ${{ github.ref_name == 'main' }}
|
||||||
|
|
||||||
|
- uses: mozilla-actions/sccache-action@v0.0.4
|
||||||
|
|
||||||
- name: Clone submodules
|
- name: Clone submodules
|
||||||
if: steps.filter.outputs.src == 'true'
|
if: steps.filter.outputs.src == 'true'
|
||||||
uses: ./.github/actions/clone-submodules
|
uses: ./.github/actions/clone-submodules
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue