From 5c81178b8f0b6413c3debd2c3d4ade0d09843d8a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 5 Oct 2022 13:08:23 +0200 Subject: [PATCH 1/3] [ci] add fmt check --- .github/workflows/fmt-check.yml | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/fmt-check.yml diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml new file mode 100644 index 00000000000..5026aeaf091 --- /dev/null +++ b/.github/workflows/fmt-check.yml @@ -0,0 +1,40 @@ +name: Quick check Formatting + +on: + push: + branches: + - "*" + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + quick_check: + strategy: + matrix: + os: ["ubuntu-latest"] + runs-on: ${{ matrix.os }} + steps: + - name: Install Rust nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: clippy, rustfmt + + - name: Cache Dependencies & Build Outputs + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions/checkout@v3 + + - name: Cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check From 90744ed337e6674debe6100a3e5803b74eaf5d98 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 5 Oct 2022 13:22:03 +0200 Subject: [PATCH 2/3] fix name --- .github/workflows/fmt-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml index 5026aeaf091..3660a568f91 100644 --- a/.github/workflows/fmt-check.yml +++ b/.github/workflows/fmt-check.yml @@ -1,4 +1,4 @@ -name: Quick check Formatting +name: Rustfmt check on: push: From 0b6bb68c78d3db8857a0d758032a671ff87623cf Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 5 Oct 2022 14:18:31 +0200 Subject: [PATCH 3/3] remove gha from branches --- .github/workflows/fmt-check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml index 3660a568f91..844dda46b8b 100644 --- a/.github/workflows/fmt-check.yml +++ b/.github/workflows/fmt-check.yml @@ -1,9 +1,6 @@ name: Rustfmt check on: - push: - branches: - - "*" pull_request: types: [opened, synchronize, reopened, ready_for_review]