From da0ff7a410104ee0d86ca826d15c0f241b5073e1 Mon Sep 17 00:00:00 2001 From: Boshen Date: Thu, 16 Mar 2023 20:33:13 +0800 Subject: [PATCH] ci: combine lint, format and test to save ci time and cache --- .github/workflows/check-rs.yaml | 53 ++++++++++----------------------- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/.github/workflows/check-rs.yaml b/.github/workflows/check-rs.yaml index c8cfb9776ae..2cd05f68629 100644 --- a/.github/workflows/check-rs.yaml +++ b/.github/workflows/check-rs.yaml @@ -22,8 +22,8 @@ concurrency: cancel-in-progress: true jobs: - lint-and-format: - name: lint, format and spell check + lint-format-test: + name: lint, format, spell check, test runs-on: ubuntu-latest steps: - name: Checkout repository @@ -34,6 +34,10 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/setup-node@v3 + with: + node-version: "16" + - name: Install toolchain run: rustup show @@ -42,16 +46,21 @@ jobs: with: shared-key: check + - name: Spell Check + uses: crate-ci/typos@master + with: + files: . + - name: Run rustfmt uses: actions-rs/cargo@v1 with: command: fmt - args: --all --verbose -- --check + args: --all -- --check - - name: Run cargo check + - name: Run Cargo Check run: cargo check --workspace --all-targets --release --locked - - name: Run clippy + - name: Run Clippy uses: actions-rs/cargo@v1 with: command: clippy @@ -60,42 +69,10 @@ jobs: - name: Check Dependencies run: node ./scripts/check_rust_dependency.js - - name: Spell Check - uses: crate-ci/typos@master - with: - files: . - - test-rs: - name: Rust test - strategy: - fail-fast: true - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/setup-node@v3 - with: - node-version: "16" - - - name: Install toolchain - run: rustup show - - - name: Cache - uses: Swatinem/rust-cache@v2 - with: - shared-key: check - - name: Run test # We need to install sass first to enable sass-loader run: | node -e "console.log(process.arch)" npm install -g pnpm@7.25.0 pnpm install - cargo test --all -- --nocapture --test-threads=1 + cargo test --workspace -- --nocapture --test-threads=1