check-generated-files.yml 2.4 KB

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