lint-core.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 core
  5. on:
  6. push:
  7. branches:
  8. - dev
  9. - 1.x
  10. pull_request:
  11. paths:
  12. - '.github/workflows/lint-core.yml'
  13. - 'core/**'
  14. - '!core/tauri/scripts/**'
  15. - 'examples/**'
  16. env:
  17. RUST_BACKTRACE: 1
  18. CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
  19. concurrency:
  20. group: ${{ github.workflow }}-${{ github.ref }}
  21. cancel-in-progress: true
  22. jobs:
  23. fmt:
  24. runs-on: ubuntu-latest
  25. steps:
  26. - uses: actions/checkout@v4
  27. - name: install Rust stable and rustfmt
  28. uses: dtolnay/rust-toolchain@stable
  29. with:
  30. components: rustfmt
  31. - name: run cargo fmt
  32. run: cargo fmt --all -- --check
  33. clippy:
  34. runs-on: ubuntu-latest
  35. strategy:
  36. matrix:
  37. clippy:
  38. - { args: '', key: 'empty' }
  39. - { args: '--all-features', key: 'all' }
  40. - { args: '--features custom-protocol', key: 'custom-protocol' }
  41. steps:
  42. - uses: actions/checkout@v4
  43. - name: install dependencies
  44. run: |
  45. sudo apt-get update
  46. sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
  47. - name: install Rust stable with clippy
  48. uses: dtolnay/rust-toolchain@stable
  49. with:
  50. components: clippy
  51. - uses: Swatinem/rust-cache@v2
  52. with:
  53. workspaces: core -> ../target
  54. save-if: ${{ matrix.clippy.key == 'all' }}
  55. - name: Run clippy - ${{ matrix.clippy.key }}
  56. run: cargo clippy --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings