Skip to content

Commit

Permalink
chore(ci): update setup-rust cache strategy (#2166)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec-ant authored Mar 22, 2024
1 parent 2edcd59 commit faf6587
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/bench_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:

- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
channel: stable
cache-target: release
cache-base: main

- name: Install hyperfine
run: cargo install hyperfine
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
channel: stable
cache-target: release
bins: cargo-codspeed
cache-base: main

- name: Compile
run: cargo codspeed build --features codspeed -p xtask_bench
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
with:
components: rustfmt
bins: taplo-cli
cache-base: main
- name: Run rustfmt
run: |
cargo fmt --all --verbose -- --check
Expand All @@ -49,6 +50,7 @@ jobs:
uses: moonrepo/setup-rust@v1
with:
components: clippy
cache-base: main
- name: Run cargo check
run: cargo check --workspace --all-targets --release
- name: Run clippy
Expand All @@ -66,6 +68,7 @@ jobs:
uses: moonrepo/setup-rust@v1
with:
channel: nightly
cache-base: main
- name: Install udeps
run: cargo install cargo-udeps --locked
- name: Run udeps
Expand All @@ -89,6 +92,7 @@ jobs:
uses: moonrepo/setup-rust@v1
with:
bins: cargo-nextest
cache-base: main
- name: Run tests on ${{ matrix.os }}
run: cargo nextest run --workspace --verbose
- name: Clean cache
Expand All @@ -114,6 +118,9 @@ jobs:
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-target: release
cache-base: main
- name: Compile
run: cargo build --release --locked -p xtask_coverage
- name: Run Test262 suite
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/parser_conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:

- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-target: release
cache-base: main

- name: Compile
run: cargo build --release --locked -p xtask_coverage
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
with:
components: rustfmt
bins: taplo-cli
cache-base: main
- name: Run format
run: |
cargo fmt --all --check
Expand All @@ -53,6 +54,7 @@ jobs:
uses: moonrepo/setup-rust@v1
with:
components: clippy
cache-base: main
- name: Run clippy
run: cargo lint

Expand Down Expand Up @@ -88,6 +90,7 @@ jobs:
uses: moonrepo/setup-rust@v1
with:
bins: cargo-nextest
cache-base: main
- name: Run tests
run: cargo nextest run --workspace --verbose
- name: Run doctests
Expand Down Expand Up @@ -116,6 +119,9 @@ jobs:
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-target: release
cache-base: main
- name: Build main binary
run: cargo build -p biome_cli --release
- name: Install Node.js
Expand Down Expand Up @@ -157,6 +163,8 @@ jobs:
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-base: main
- name: Run doc command
run: cargo documentation

Expand All @@ -170,6 +178,8 @@ jobs:
uses: ./.github/actions/free-disk-space
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-base: main
- name: Run the grammar codegen
run: cargo codegen grammar
- name: Run the analyzer codegen
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pull_request_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ jobs:
- uses: pnpm/action-setup@v3
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-base: main
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WASM module for the web
run: wasm-pack build --out-dir ../../packages/@biomejs/wasm-web --target web --scope biomedev crates/biome_wasm
run: wasm-pack build --dev --out-dir ../../packages/@biomejs/wasm-web --target web --scope biomedev crates/biome_wasm
- name: Install libraries
run: pnpm i --filter @biomejs/website
- name: Build JS
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- uses: pnpm/action-setup@v3
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-target: release
cache-base: main
- name: Install libraries
run: pnpm --filter @biomejs/js-api i
- name: Compile backends
Expand Down

0 comments on commit faf6587

Please sign in to comment.