2023-02-19 16:17:49 +03:00
|
|
|
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
2022-10-17 18:09:23 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2023-05-22 18:52:44 +03:00
|
|
|
name: check generated files
|
2022-10-17 18:09:23 +03:00
|
|
|
|
|
|
|
on:
|
2022-12-12 16:36:25 +03:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- '.github/workflows/check-generated-files.yml'
|
2022-10-17 18:09:23 +03:00
|
|
|
- 'tooling/api/src/**'
|
|
|
|
- 'core/tauri/scripts/bundle.global.js'
|
|
|
|
- 'core/tauri-utils/src/config.rs'
|
|
|
|
- 'tooling/cli/schema.json'
|
2023-04-07 18:11:05 +03:00
|
|
|
- 'core/tauri-config-schema/schema.json'
|
2022-10-17 18:09:23 +03:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
changes:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2023-02-22 16:10:54 +03:00
|
|
|
api: ${{ steps.filter.outputs.api }}
|
2022-10-17 18:09:23 +03:00
|
|
|
schema: ${{ steps.filter.outputs.schema }}
|
|
|
|
steps:
|
2023-02-22 16:10:54 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-17 18:09:23 +03:00
|
|
|
- uses: dorny/paths-filter@v2
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
2023-02-22 16:10:54 +03:00
|
|
|
api:
|
2022-10-17 18:09:23 +03:00
|
|
|
- 'tooling/api/src/**'
|
2023-02-22 16:10:54 +03:00
|
|
|
- 'tooling/api/docs/js-api.json'
|
2022-10-17 18:09:23 +03:00
|
|
|
- 'core/tauri/scripts/bundle.global.js'
|
|
|
|
schema:
|
|
|
|
- 'core/tauri-utils/src/config.rs'
|
|
|
|
- 'tooling/cli/schema.json'
|
2023-04-07 18:11:05 +03:00
|
|
|
- 'core/tauri-config-schema/schema.json'
|
2022-10-17 18:09:23 +03:00
|
|
|
|
2023-05-22 18:52:44 +03:00
|
|
|
api:
|
2022-10-17 18:09:23 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: changes
|
2023-02-22 16:10:54 +03:00
|
|
|
if: needs.changes.outputs.api == 'true'
|
2022-10-17 18:09:23 +03:00
|
|
|
steps:
|
2023-02-22 16:10:54 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-11-05 00:26:30 +03:00
|
|
|
|
2023-02-22 16:10:54 +03:00
|
|
|
- name: build api
|
2022-10-17 18:09:23 +03:00
|
|
|
working-directory: tooling/api
|
|
|
|
run: yarn && yarn build
|
2023-02-22 16:10:54 +03:00
|
|
|
- name: check api
|
2023-03-17 19:13:02 +03:00
|
|
|
run: |
|
|
|
|
git restore tooling/api/docs/js-api.json
|
|
|
|
./.scripts/ci/has-diff.sh
|
2022-10-17 18:09:23 +03:00
|
|
|
|
2023-05-22 18:52:44 +03:00
|
|
|
schema:
|
2022-10-17 18:09:23 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: changes
|
|
|
|
if: needs.changes.outputs.schema == 'true'
|
|
|
|
steps:
|
2023-02-22 16:10:54 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-17 18:09:23 +03:00
|
|
|
|
|
|
|
- name: install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: install Linux dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y libgtk-3-dev
|
|
|
|
|
2022-11-05 00:26:30 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2022-11-06 22:27:29 +03:00
|
|
|
with:
|
|
|
|
workspaces: core -> ../target
|
2022-10-17 18:09:23 +03:00
|
|
|
|
|
|
|
- name: generate schema.json
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2023-04-07 18:11:05 +03:00
|
|
|
args: --manifest-path ./core/tauri-config-schema/Cargo.toml
|
2022-10-17 18:09:23 +03:00
|
|
|
|
|
|
|
- name: check schema
|
|
|
|
run: ./.scripts/ci/has-diff.sh
|