chore: Update rust-cache and add it to more jobs
MODIFY
.github/workflows/bench_analyzer.yml
.github/workflows/bench_analyzer.yml
@@ -36,7 +36,9 @@ jobs:
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "xtask-release"
- name: Install critcmp
run: cargo install critcmp

MODIFY
.github/workflows/bench_cli.yml
.github/workflows/bench_cli.yml
@@ -36,7 +36,9 @@ jobs:
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "cli-release"
- name: Install hyperfine
run: cargo install hyperfine

MODIFY
.github/workflows/bench_formatter.yml
.github/workflows/bench_formatter.yml
@@ -36,7 +36,9 @@ jobs:
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "xtask-release"
- name: Install critcmp
run: cargo install critcmp

MODIFY
.github/workflows/bench_parser.yml
.github/workflows/bench_parser.yml
@@ -35,7 +35,9 @@ jobs:
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "xtask-release"
- name: Install critcmp
run: cargo install critcmp

MODIFY
.github/workflows/main.yml
.github/workflows/main.yml
@@ -28,8 +28,6 @@ jobs:
uses: actions/checkout@v3
- name: Install toolchain
run: rustup show
- - name: Cache
- uses: Swatinem/rust-cache@v1
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
@@ -45,7 +43,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: check
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
@@ -73,7 +73,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: test
- name: Compile for tests
uses: actions-rs/cargo@v1
with:
@@ -81,8 +83,6 @@ jobs:
args: --no-run --workspace --verbose
- name: Run tests on ${{ matrix.os }}
uses: actions-rs/cargo@v1
- env:
- RUST_TEST_THREADS: 1
with:
command: test
args: --workspace --verbose
@@ -101,9 +101,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
- - name: Compile for tests
- uses: actions-rs/cargo@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: doc
- name: Run doc command
uses: actions-rs/cargo@v1
with:
@@ -133,7 +133,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "xtask-release"
- name: Compile
run: cargo build --release --locked -p xtask_coverage
- name: Run Test262 suite

MODIFY
.github/workflows/parser_conformance.yml
.github/workflows/parser_conformance.yml
@@ -43,7 +43,9 @@ jobs:
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "xtask-release"
- name: Compile
run: cargo build --release --locked -p xtask_coverage

MODIFY
.github/workflows/pull_request.yml
.github/workflows/pull_request.yml
@@ -25,8 +25,6 @@ jobs:
uses: actions/checkout@v3
- name: Install toolchain
run: rustup show
- - name: Cache
- uses: Swatinem/rust-cache@v1
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
@@ -44,17 +42,19 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "check"
+ - name: Run clippy
+ uses: actions-rs/clippy-check@v1
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ args: --workspace --all-targets --verbose -- --deny warnings
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-targets --release
- - name: Run clippy
- uses: actions-rs/cargo@v1
- with:
- command: clippy
- args: --workspace --all-targets --verbose -- --deny warnings
test:
name: Test
@@ -65,8 +65,14 @@ jobs:
uses: actions/checkout@v3
- name: Install toolchain
run: rustup show
+ - name: Install nextest
+ run: "curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin"
+
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "test"
+ cache-on-failure: true
- name: Compile for tests
uses: actions-rs/cargo@v1
with:
@@ -74,11 +80,14 @@ jobs:
args: --no-run --workspace --verbose
- name: Run tests
uses: actions-rs/cargo@v1
- env:
- RUST_TEST_THREADS: 1
+ with:
+ command: nextest
+ args: run --workspace --verbose
+ - name: Run doctests
+ uses: actions-rs/cargo@v1
with:
command: test
- args: --workspace --verbose
+ args: --doc
test-node-api:
name: Test node.js API
@@ -92,7 +101,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "cli-wasm" # Rome release + WASM
- name: Build main binary
uses: actions-rs/cargo@v1
with:
@@ -140,9 +151,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
- - name: Compile for tests
- uses: actions-rs/cargo@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "doc"
- name: Run doc command
uses: actions-rs/cargo@v1
with:
@@ -158,7 +169,9 @@ jobs:
- name: Install toolchain
run: rustup show
- name: Cache
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "xtask"
- name: Run the grammar codegen
uses: actions-rs/cargo@v1
with:

MODIFY
.github/workflows/pull_request_js.yml
.github/workflows/pull_request_js.yml
@@ -22,6 +22,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
+ - name: Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "cli-release"
- name: Run Rome Format
run: cargo rome-cli ci editors website npm/js-api
@@ -44,6 +48,10 @@ jobs:
- uses: pnpm/action-setup@v2.1.0
with:
version: 7
+ - name: Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "wasm"
- name: Build WASM module for the web
run: wasm-pack build --out-dir ../../npm/wasm-web --target web --scope rometools crates/rome_wasm
- name: Install libraries

MODIFY
.github/workflows/runtime.yml
.github/workflows/runtime.yml
@@ -41,6 +41,10 @@ jobs:
- uses: pnpm/action-setup@v2.1.0
with:
version: 7
+ - name: Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: "wasm"
- name: Install libraries
working-directory: npm/js-api
run: pnpm i

chore: Update rust-cache and add it to more jobs (#3871)