diff --git a/.github/workflows/bench_analyzer.yml b/.github/workflows/bench_analyzer.yml index 74fda0b84fd..cf816ab5fad 100644 --- a/.github/workflows/bench_analyzer.yml +++ b/.github/workflows/bench_analyzer.yml @@ -33,12 +33,7 @@ jobs: ref: ${{ steps.sha.outputs.result }} - name: Install toolchain - run: rustup show - - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "xtask-release" + uses: moonrepo/setup-rust@v0 - name: Install critcmp run: cargo install critcmp diff --git a/.github/workflows/bench_cli.yml b/.github/workflows/bench_cli.yml index a497fc6b17b..eb38586b170 100644 --- a/.github/workflows/bench_cli.yml +++ b/.github/workflows/bench_cli.yml @@ -33,12 +33,7 @@ jobs: ref: ${{ steps.sha.outputs.result }} - name: Install toolchain - run: rustup show - - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "cli-release" + uses: moonrepo/setup-rust@v0 - name: Install hyperfine run: cargo install hyperfine diff --git a/.github/workflows/bench_formatter.yml b/.github/workflows/bench_formatter.yml index d4b2abae45f..216e4e0dc30 100644 --- a/.github/workflows/bench_formatter.yml +++ b/.github/workflows/bench_formatter.yml @@ -33,12 +33,7 @@ jobs: ref: ${{ steps.sha.outputs.result }} - name: Install toolchain - run: rustup show - - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "xtask-release" + uses: moonrepo/setup-rust@v0 - name: Install critcmp run: cargo install critcmp diff --git a/.github/workflows/bench_parser.yml b/.github/workflows/bench_parser.yml index 5d6f06928eb..9d7f7519fb1 100644 --- a/.github/workflows/bench_parser.yml +++ b/.github/workflows/bench_parser.yml @@ -32,12 +32,7 @@ jobs: ref: ${{ steps.sha.outputs.result }} - name: Install toolchain - run: rustup show - - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "xtask-release" + uses: moonrepo/setup-rust@v0 - name: Install critcmp run: cargo install critcmp diff --git a/.github/workflows/parser_conformance.yml b/.github/workflows/parser_conformance.yml index 29ce1a25dee..3308860dffb 100644 --- a/.github/workflows/parser_conformance.yml +++ b/.github/workflows/parser_conformance.yml @@ -40,12 +40,7 @@ jobs: submodules: recursive - name: Install toolchain - run: rustup show - - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "xtask-release" + uses: moonrepo/setup-rust@v0 - name: Compile run: cargo build --release --locked -p xtask_coverage diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fa48f3a3783..b706b7f2d71 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -24,12 +24,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Install toolchain - run: rustup show - - name: Run rustfmt - uses: actions-rs/cargo@v1 + uses: moonrepo/setup-rust@v0 with: - command: fmt - args: --all --verbose -- --check + components: rustfmt + - name: Run rustfmt + run: cargo fmt --all --check lint: name: Lint Rust Files @@ -40,20 +39,11 @@ jobs: with: submodules: false - name: Install toolchain - run: rustup show - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "check" - - name: Run clippy - uses: actions-rs/clippy-check@v1 + uses: moonrepo/setup-rust@v0 with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --all-targets --all-features --verbose -- --deny warnings -W clippy::cargo -W clippy::dbg_macro -A clippy::cargo_common_metadata -A clippy::multiple_crate_versions + components: clippy - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: lint + run: cargo lint check-dependencies: name: Check Dependencies @@ -63,10 +53,6 @@ jobs: uses: actions/checkout@v3 with: submodules: false - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "dependencies" - name: Install toolchain run: rustup toolchain install nightly - name: Install udeps @@ -89,30 +75,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Install toolchain - run: rustup show - - name: Install latest nextest release - uses: taiki-e/install-action@nextest - - - name: Cache - uses: Swatinem/rust-cache@v2 + uses: moonrepo/setup-rust@v0 with: - shared-key: "test" - cache-on-failure: true + bins: nextest - name: Compile for tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-run --workspace --verbose + run: cargo test --no-run --workspace --verbose - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: nextest - args: run --workspace --verbose + run: cargo nextest run --workspace --verbose - name: Run doctests - uses: actions-rs/cargo@v1 - with: - command: test - args: --doc + run: cargo test --doc test-node-api: name: Test node.js API @@ -124,16 +95,9 @@ jobs: with: fetch-depth: 1 - name: Install toolchain - run: rustup show - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "cli-wasm" # Rome release + WASM + uses: moonrepo/setup-rust@v0 - name: Build main binary - uses: actions-rs/cargo@v1 - with: - command: build - args: -p rome_cli --release + run: cargo build -p rome_cli --release - name: Install Node.js uses: actions/setup-node@v3 @@ -174,15 +138,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Install toolchain - run: rustup show - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "doc" + uses: moonrepo/setup-rust@v0 - name: Run doc command - uses: actions-rs/cargo@v1 - with: - command: documentation + run: cargo documentation codegen: name: Codegen @@ -192,37 +150,19 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Install toolchain - run: rustup show - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "xtask" + uses: moonrepo/setup-rust@v0 - name: Run the grammar codegen - uses: actions-rs/cargo@v1 - with: - command: codegen - args: grammar + run: cargo codegen grammar - name: Run the analyzer codegen - uses: actions-rs/cargo@v1 - with: - command: codegen - args: analyzer + run: cargo codegen analyzer - name: Run the configuration codegen - uses: actions-rs/cargo@v1 - with: - command: codegen-configuration + run: cargo codegen-configuration - name: Run the schema codegen - uses: actions-rs/cargo@v1 - with: - command: codegen-schema + run: cargo codegen-schema - name: Run the bindings codegen - uses: actions-rs/cargo@v1 - with: - command: codegen-bindings + run: cargo codegen-bindings - name: Run the website codegen - uses: actions-rs/cargo@v1 - with: - command: lintdoc + run: cargo lintdoc - name: Check for git diff run: | if [[ `git status --porcelain` ]]; then diff --git a/.github/workflows/pull_request_js.yml b/.github/workflows/pull_request_js.yml index 32758acd8fe..996c83ca42b 100644 --- a/.github/workflows/pull_request_js.yml +++ b/.github/workflows/pull_request_js.yml @@ -48,10 +48,8 @@ jobs: - uses: pnpm/action-setup@v2.1.0 with: version: 7 - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "wasm" + - name: Install toolchain + uses: moonrepo/setup-rust@v0 - 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 diff --git a/.github/workflows/release_lsp.yml b/.github/workflows/release_lsp.yml index bf7845f3269..6a65e74ac64 100644 --- a/.github/workflows/release_lsp.yml +++ b/.github/workflows/release_lsp.yml @@ -109,8 +109,10 @@ jobs: with: fetch-depth: 1 - - name: Install Rust toolchain - run: rustup target add ${{ matrix.target }} + - name: Install toolchain + uses: moonrepo/setup-rust@v0 + with: + targets: ${{ matrix.target }} - name: Install arm64 toolchain if: matrix.code-target == 'linux-arm64' diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index 76245839039..bf6385d3dfe 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -41,10 +41,8 @@ jobs: - uses: pnpm/action-setup@v2.1.0 with: version: 7 - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: "wasm" + - name: Install toolchain + uses: moonrepo/setup-rust@v0 - name: Install libraries working-directory: npm/js-api run: pnpm i diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d446fc86b9b..b2d4a1a0792 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,4 +2,4 @@ # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. # https://rust-lang.github.io/rustup/concepts/profiles.html profile = "default" -channel = "1.68.0" +channel = "1.69.0"