From 96479e8299069b776be5e2c3cb51318550f28f98 Mon Sep 17 00:00:00 2001 From: Bob Liu Date: Tue, 26 Nov 2024 22:03:27 +0800 Subject: [PATCH] feat: update workflow templates --- .../{ => properties}/rust.properties.json | 0 .../super_linter.properties.json | 0 workflow-templates/rust.yml | 49 +++++++------------ workflow-templates/super_linter.yml | 24 +++++---- 4 files changed, 33 insertions(+), 40 deletions(-) rename workflow-templates/{ => properties}/rust.properties.json (100%) rename workflow-templates/{ => properties}/super_linter.properties.json (100%) diff --git a/workflow-templates/rust.properties.json b/workflow-templates/properties/rust.properties.json similarity index 100% rename from workflow-templates/rust.properties.json rename to workflow-templates/properties/rust.properties.json diff --git a/workflow-templates/super_linter.properties.json b/workflow-templates/properties/super_linter.properties.json similarity index 100% rename from workflow-templates/super_linter.properties.json rename to workflow-templates/properties/super_linter.properties.json diff --git a/workflow-templates/rust.yml b/workflow-templates/rust.yml index fa43f67..0ff3088 100644 --- a/workflow-templates/rust.yml +++ b/workflow-templates/rust.yml @@ -12,39 +12,26 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Toolchain - uses: actions-rs/toolchain@v1 + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@main with: - toolchain: nightly - target: wasm32-unknown-unknown - profile: minimal - components: rustfmt,clippy - override: true - - - name: Cache - uses: Swatinem/rust-cache@v2 - - - name: Check - uses: actions-rs/cargo@v1 + access_token: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@nightly with: - command: check - args: --release - - - name: Test - uses: actions-rs/cargo@v1 + components: clippy,rustfmt,miri + - uses: taiki-e/install-action@v2 with: - command: test - - - name: Format - uses: actions-rs/cargo@v1 + tool: cargo-sort,cargo-machete + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 with: - command: fmt - args: --all -- --check - - - name: Clippy - uses: actions-rs/clippy-check@v1 + cache-on-failure: true + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all -- -D warnings + version: nightly + - name: Install Protoc + uses: arduino/setup-protoc@v3 diff --git a/workflow-templates/super_linter.yml b/workflow-templates/super_linter.yml index 03cabc1..fb1facd 100644 --- a/workflow-templates/super_linter.yml +++ b/workflow-templates/super_linter.yml @@ -11,16 +11,22 @@ jobs: name: Super Linter runs-on: ubuntu-latest + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 - - name: Run super-linter - uses: github/super-linter/slim@v4 + - name: Super-linter + uses: super-linter/super-linter@v7.2.0 # x-release-please-version env: - VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: master + # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # LINTER_RULES_PATH: .github/linters - # LINTER_RULES_PATH: .github/linters - # LINTER_RULES_PATH: .github/linters - # LINTER