From f8c1cdba8421053e18dd322a328942a578d0eac2 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Sun, 30 Apr 2023 19:00:35 +0100 Subject: [PATCH] chore: new Rust version and change actions --- .github/workflows/pull_request.yml | 106 +++++++---------------------- rust-toolchain.toml | 2 +- 2 files changed, 24 insertions(+), 84 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fa48f3a3783..868b51120a0 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 + uses: moonrepo/setup-rust@v0 + components: + - rustfmt - name: Run rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all --verbose -- --check + run: cargo fmt --all --verbose -- --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 - 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 + uses: moonrepo/setup-rust@v0 + 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 + uses: moonrepo/setup-rust@v0 - name: Install latest nextest release uses: taiki-e/install-action@nextest - - - name: Cache - 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 + 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/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"