From e38ab60e1e4f565f0dafdb7b539e386a390594d7 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Wed, 26 Apr 2023 21:56:40 +0200 Subject: Run `cargo clippy` in CI on each push (#292) Clippy checks for common errors and fails the CI if one is spotted --- .github/workflows/push-test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/push-test.yml b/.github/workflows/push-test.yml index d89c868d..4cac9da3 100644 --- a/.github/workflows/push-test.yml +++ b/.github/workflows/push-test.yml @@ -27,6 +27,34 @@ jobs: - name: Format check run: cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check + clippy: + strategy: + fail-fast: false + matrix: + platform: [ubuntu-22.04, windows-latest] + + name: clippy-check + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-22.04' + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf + - name: Create dist folder (Ubuntu only) + if: matrix.platform == 'ubuntu-22.04' + run: mkdir --parent src-vue/dist + - name: Create dist folder (Windows only) + if: matrix.platform == 'windows-latest' + run: New-Item -ItemType Directory -Force -Path "src-vue\dist" + - name: Run clippy + run: cargo clippy --manifest-path src-tauri/Cargo.toml -- --no-deps --deny warnings + # Ensure committed bindings correct autogen-ts-bindings-check: runs-on: ubuntu-latest -- cgit v1.2.3