lint-cli.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 2019-2024 Tauri Programme within The Commons Conservancy
  2. # SPDX-License-Identifier: Apache-2.0
  3. # SPDX-License-Identifier: MIT
  4. name: lint cli
  5. on:
  6. push:
  7. branches:
  8. - dev
  9. - 1.x
  10. pull_request:
  11. paths:
  12. - '.github/workflows/lint-cli.yml'
  13. - 'tooling/cli/**'
  14. env:
  15. RUST_BACKTRACE: 1
  16. CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
  17. concurrency:
  18. group: ${{ github.workflow }}-${{ github.ref }}
  19. cancel-in-progress: true
  20. jobs:
  21. fmt:
  22. runs-on: ubuntu-latest
  23. steps:
  24. - uses: actions/checkout@v4
  25. - name: install Rust stable and rustfmt
  26. uses: dtolnay/rust-toolchain@stable
  27. with:
  28. components: rustfmt
  29. - name: Run cargo fmt
  30. run: cargo fmt --manifest-path ./tooling/cli/Cargo.toml --all -- --check
  31. clippy:
  32. runs-on: ubuntu-latest
  33. steps:
  34. - uses: actions/checkout@v4
  35. - name: install Rust stable and clippy
  36. uses: dtolnay/rust-toolchain@stable
  37. with:
  38. components: clippy
  39. - name: install dependencies
  40. run: |
  41. sudo apt-get update
  42. sudo apt-get install -y libgtk-3-dev
  43. - uses: Swatinem/rust-cache@v2
  44. with:
  45. workspaces: tooling/cli
  46. - name: run Clippy
  47. run: cargo clippy --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings