check-generated-files.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 2019-2024 Tauri Programme within The Commons Conservancy
  2. # SPDX-License-Identifier: Apache-2.0
  3. # SPDX-License-Identifier: MIT
  4. name: check generated files
  5. on:
  6. pull_request:
  7. paths:
  8. - '.github/workflows/check-generated-files.yml'
  9. - 'tooling/api/src/**'
  10. - 'core/tauri/scripts/bundle.global.js'
  11. - 'core/tauri-utils/src/config.rs'
  12. - 'tooling/cli/schema.json'
  13. - 'core/tauri-config-schema/schema.json'
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.ref }}
  16. cancel-in-progress: true
  17. jobs:
  18. changes:
  19. runs-on: ubuntu-latest
  20. outputs:
  21. api: ${{ steps.filter.outputs.api }}
  22. schema: ${{ steps.filter.outputs.schema }}
  23. steps:
  24. - uses: actions/checkout@v4
  25. - uses: dorny/paths-filter@v2
  26. id: filter
  27. with:
  28. filters: |
  29. api:
  30. - 'tooling/api/src/**'
  31. - 'core/tauri/scripts/bundle.global.js'
  32. schema:
  33. - 'core/tauri-utils/src/config.rs'
  34. - 'tooling/cli/schema.json'
  35. - 'core/tauri-config-schema/schema.json'
  36. api:
  37. runs-on: ubuntu-latest
  38. needs: changes
  39. if: needs.changes.outputs.api == 'true'
  40. steps:
  41. - uses: actions/checkout@v4
  42. - name: build api
  43. working-directory: tooling/api
  44. run: yarn && yarn build
  45. - name: check api
  46. run: ./.scripts/ci/has-diff.sh
  47. schema:
  48. runs-on: ubuntu-latest
  49. needs: changes
  50. if: needs.changes.outputs.schema == 'true'
  51. steps:
  52. - uses: actions/checkout@v4
  53. - name: install stable
  54. uses: dtolnay/rust-toolchain@stable
  55. - name: install Linux dependencies
  56. run: |
  57. sudo apt-get update
  58. sudo apt-get install -y libgtk-3-dev
  59. - uses: Swatinem/rust-cache@v2
  60. with:
  61. workspaces: core -> ../target
  62. - name: generate schema.json
  63. run: cargo build --manifest-path ./core/tauri-config-schema/Cargo.toml
  64. - name: check schema
  65. run: ./.scripts/ci/has-diff.sh