lint-fmt-core.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
  2. # SPDX-License-Identifier: Apache-2.0
  3. # SPDX-License-Identifier: MIT
  4. name: core clippy and fmt check
  5. on:
  6. push:
  7. branches:
  8. - dev
  9. - next
  10. pull_request:
  11. paths:
  12. - '.github/workflows/lint-fmt-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_check:
  24. runs-on: ubuntu-latest
  25. steps:
  26. - uses: actions/checkout@v2
  27. - uses: actions-rs/toolchain@v1
  28. with:
  29. profile: minimal
  30. toolchain: stable
  31. override: true
  32. components: rustfmt
  33. - uses: actions-rs/cargo@v1
  34. with:
  35. command: fmt
  36. args: --all -- --check
  37. core_clippy_check:
  38. runs-on: ubuntu-latest
  39. strategy:
  40. matrix:
  41. clippy:
  42. - { args: '', key: 'empty' }
  43. - {
  44. args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart',
  45. key: 'all'
  46. }
  47. - { args: '--features custom-protocol', key: 'custom-protocol' }
  48. - { args: '--features api-all', key: 'api-all' }
  49. steps:
  50. - uses: actions/checkout@v2
  51. - name: install dependencies
  52. run: |
  53. sudo apt-get update
  54. sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
  55. - uses: actions-rs/toolchain@v1
  56. with:
  57. profile: minimal
  58. toolchain: stable
  59. override: true
  60. components: clippy
  61. - uses: Swatinem/rust-cache@v2
  62. with:
  63. workspaces: core -> ../target
  64. save-if: ${{ matrix.clippy.key == 'all' }}
  65. - uses: actions-rs/clippy-check@v1
  66. with:
  67. token: ${{ secrets.GITHUB_TOKEN }}
  68. args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
  69. name: ${{ matrix.clippy.key }}