From a67e7d184a1cc20652a1fa44d4d9837b664d577b Mon Sep 17 00:00:00 2001 From: Atul Bhosale Date: Fri, 15 May 2020 22:43:21 +0530 Subject: [PATCH 1/2] CI: Add cargo fmt step --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54c5075..faafd8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,3 +52,18 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features + + lint: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check From d9b5e495516bdc20e19e9527fd658044bd2c7ac6 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sun, 30 Aug 2020 18:51:28 +0200 Subject: [PATCH 2/2] CI: Always run rustfmt on fixed Rust version Otherwise a new release of rustfmt may break CI without any change to the code. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faafd8b..3cf2836 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: rust: [1.39.0, stable] runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust }} @@ -42,7 +42,7 @@ jobs: name: run clippy lints runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: 1.46.0 @@ -53,14 +53,14 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features - lint: - name: Rustfmt + fmt: + name: run rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.46.0 override: true - run: rustup component add rustfmt - uses: actions-rs/cargo@v1