From 37e9f5ecdb80e866f579a22f41a582f51bdda866 Mon Sep 17 00:00:00 2001 From: tin-snowflake <56880684+chungquantin@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:48:14 +0800 Subject: [PATCH] Update ci.yml --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a56a6bfb..10e2635f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,37 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} args: --release --locked --features=runtime-benchmarks + format: + needs: check + timeout-minutes: 20 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup worker + uses: "./.github/templates/setup-worker" + + - name: Cache Build artefacts + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-debug + + - name: Format check packages + run: cargo +nightly fmt --all -- --check + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "style: apply formatting changes" + branch: ${{ github.head_ref }} + test: needs: lint runs-on: ubuntu-latest