-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
82 lines (70 loc) · 2.17 KB
/
check-generated-files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check generated files
on:
pull_request:
paths:
- '.github/workflows/check-generated-files.yml'
- 'packages/api/src/**'
- 'crates/tauri/scripts/bundle.global.js'
- 'crates/tauri-utils/src/config.rs'
- 'crates/tauri-cli/config.schema.json'
- 'crates/tauri-schema-generator/schemas/*.json'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
api: ${{ steps.filter.outputs.api }}
schema: ${{ steps.filter.outputs.schema }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
api:
- 'packages/api/src/**'
- 'crates/tauri/scripts/bundle.global.js'
schema:
- 'crates/tauri-utils/src/config.rs'
- 'crates/tauri-cli/config.schema.json'
- 'crates/tauri-schema-generator/schemas/*.json'
api:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.api == 'true'
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: install deps
run: pnpm i --frozen-lockfile
- name: build api
run: pnpm build
working-directory: packages/api
- name: check api
run: ./.scripts/ci/has-diff.sh
schema:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.schema == 'true'
steps:
- uses: actions/checkout@v4
- name: install stable
uses: dtolnay/rust-toolchain@stable
- name: install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- uses: Swatinem/rust-cache@v2
- name: generate schemas
run: cargo build --manifest-path ./crates/tauri-schema-generator/Cargo.toml
- name: check schemas
run: ./.scripts/ci/has-diff.sh