name: Lint Rust on: push: branches: - dev paths: - ".github/workflows/lint-rust.yml" - "plugins/src/**" - "**/Cargo.toml" pull_request: branches: - dev paths: - ".github/workflows/lint-rust.yml" - "plugins/src/**" - "**/Cargo.toml" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: clippy: runs-on: ubuntu-latest strategy: fail-fast: false steps: - uses: actions/checkout@v3 - name: install webkit2gtk run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.0 - name: install libudev for [authenticator] run: | sudo apt-get install -y libudev-dev - name: Install clippy with stable toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true components: clippy - uses: Swatinem/rust-cache@v1 - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --all --all-targets --all-features -- -D warnings name: clippy fmt: runs-on: ubuntu-latest strategy: fail-fast: false steps: - uses: actions/checkout@v3 - name: Install rustfmt with nightly toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly override: true components: rustfmt - uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check