check-generated-files.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # Copyright 2019-2023 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@v3
  25. - uses: dorny/paths-filter@v2
  26. id: filter
  27. with:
  28. filters: |
  29. api:
  30. - 'tooling/api/src/**'
  31. - 'tooling/api/docs/js-api.json'
  32. - 'core/tauri/scripts/bundle.global.js'
  33. schema:
  34. - 'core/tauri-utils/src/config.rs'
  35. - 'tooling/cli/schema.json'
  36. - 'core/tauri-config-schema/schema.json'
  37. api:
  38. runs-on: ubuntu-latest
  39. needs: changes
  40. if: needs.changes.outputs.api == 'true'
  41. steps:
  42. - uses: actions/checkout@v3
  43. - name: build api
  44. working-directory: tooling/api
  45. run: yarn && yarn build
  46. - name: check api
  47. run: |
  48. git restore tooling/api/docs/js-api.json
  49. ./.scripts/ci/has-diff.sh
  50. schema:
  51. runs-on: ubuntu-latest
  52. needs: changes
  53. if: needs.changes.outputs.schema == 'true'
  54. steps:
  55. - uses: actions/checkout@v3
  56. - name: install stable
  57. uses: actions-rs/toolchain@v1
  58. with:
  59. toolchain: stable
  60. override: true
  61. - name: install Linux dependencies
  62. run: |
  63. sudo apt-get update
  64. sudo apt-get install -y libgtk-3-dev
  65. - uses: Swatinem/rust-cache@v2
  66. with:
  67. workspaces: core -> ../target
  68. - name: generate schema.json
  69. uses: actions-rs/cargo@v1
  70. with:
  71. command: build
  72. args: --manifest-path ./core/tauri-config-schema/Cargo.toml
  73. - name: check schema
  74. run: ./.scripts/ci/has-diff.sh