check-generated-files.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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/config-schema/schema.json'
  14. push:
  15. branches:
  16. - dev
  17. paths:
  18. - '.github/workflows/check-generated-files.yml'
  19. - 'tooling/api/src/**'
  20. - 'core/tauri/scripts/bundle.global.js'
  21. - 'core/tauri-utils/src/config.rs'
  22. - 'tooling/cli/schema.json'
  23. - 'core/config-schema/schema.json'
  24. concurrency:
  25. group: ${{ github.workflow }}-${{ github.ref }}
  26. cancel-in-progress: true
  27. jobs:
  28. changes:
  29. runs-on: ubuntu-latest
  30. outputs:
  31. api: ${{ steps.filter.outputs.api }}
  32. schema: ${{ steps.filter.outputs.schema }}
  33. steps:
  34. - uses: actions/checkout@v3
  35. - uses: dorny/paths-filter@v2
  36. id: filter
  37. with:
  38. filters: |
  39. api:
  40. - 'tooling/api/src/**'
  41. - 'tooling/api/docs/js-api.json'
  42. - 'core/tauri/scripts/bundle.global.js'
  43. schema:
  44. - 'core/tauri-utils/src/config.rs'
  45. - 'tooling/cli/schema.json'
  46. - 'core/config-schema/schema.json'
  47. check-api:
  48. runs-on: ubuntu-latest
  49. needs: changes
  50. if: needs.changes.outputs.api == 'true'
  51. steps:
  52. - uses: actions/checkout@v3
  53. - name: build api
  54. working-directory: tooling/api
  55. run: yarn && yarn build
  56. - name: check api
  57. run: |
  58. git restore tooling/api/docs/js-api.json
  59. ./.scripts/ci/has-diff.sh
  60. check-schema:
  61. runs-on: ubuntu-latest
  62. needs: changes
  63. if: needs.changes.outputs.schema == 'true'
  64. steps:
  65. - uses: actions/checkout@v3
  66. - name: install stable
  67. uses: actions-rs/toolchain@v1
  68. with:
  69. toolchain: stable
  70. override: true
  71. - name: install Linux dependencies
  72. run: |
  73. sudo apt-get update
  74. sudo apt-get install -y libgtk-3-dev
  75. - uses: Swatinem/rust-cache@v2
  76. with:
  77. workspaces: core -> ../target
  78. - name: generate schema.json
  79. uses: actions-rs/cargo@v1
  80. with:
  81. command: build
  82. args: --manifest-path ./core/config-schema/Cargo.toml
  83. - name: check schema
  84. run: ./.scripts/ci/has-diff.sh