Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

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

Merged
merged 17 commits into from
Nov 28, 2022
Merged
4 changes: 3 additions & 1 deletion .github/workflows/bench_analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bench_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bench_formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bench_parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -73,16 +73,16 @@ 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:
command: test
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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/parser_conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 30 additions & 17 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -65,20 +65,29 @@ 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:
command: test
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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pull_request_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,6 +48,10 @@ jobs:
- uses: pnpm/[email protected]
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
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ jobs:
- uses: pnpm/[email protected]
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
- name: Compile backends
run: |
run: |
pnpm --prefix npm/js-api build:wasm-bundler
pnpm --prefix npm/js-api build:wasm-node
pnpm --prefix npm/js-api build:wasm-web
Expand Down