-
-
Notifications
You must be signed in to change notification settings - Fork 586
216 lines (201 loc) · 6.75 KB
/
Copy pathcodegen_drift.yml
File metadata and controls
216 lines (201 loc) · 6.75 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
---
name: Codegen drift
on:
push:
branches:
- 'main'
- '[0-9]+.[0-9]+'
paths: &trigger-paths
- '.github/workflows/codegen_drift.yml'
- '.github/actions/codegen_drift/action.yml'
- 'Justfile'
# cfn sort order
- 'tools/cfn_sorter.sh'
- 'tools/cfn_sorter.cpp'
- 'tools/copyright-header.txt'
- 'radio/src/dataconstants.h'
- 'radio/src/cfn_sort.cpp'
# LVGL fonts
- 'radio/src/fonts/**'
# shared: the i18n headers feed both the fonts and the cfn sort order
- 'radio/src/translations/i18n/**'
# YAML parsers
- 'tools/generate-yaml.sh'
- 'tools/build-common.sh'
- 'radio/src/myeeprom.h'
- 'radio/src/datastructs.h'
- 'radio/src/storage/yaml/**'
- 'radio/util/generate_yaml.py'
- 'radio/util/yaml_parser.tmpl'
- 'radio/util/hw_defs/**'
- 'radio/src/boards/hw_defs/**'
# web simulator radio list (also fed by the hw_defs above)
- 'fw.json'
- 'web/scripts/gen-radios-json.js'
- 'web/public/radios.json'
pull_request:
paths: *trigger-paths
workflow_dispatch:
# These jobs only ever report - they must never block a contributor who does not
# have the local toolchain, so nothing here fails on drift.
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
JUST_VERSION: '1.57.0'
jobs:
changes:
name: Detect changed inputs
runs-on: ubuntu-latest
outputs:
cfn: ${{ steps.filter.outputs.cfn }}
fonts: ${{ steps.filter.outputs.fonts }}
yaml: ${{ steps.filter.outputs.yaml }}
radios: ${{ steps.filter.outputs.radios }}
steps:
- name: Check out the repo
uses: actions/checkout@v7
- name: Install just
run: |
wget -qO- "https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
| tar xz -C /usr/local/bin just
# A Justfile change cannot cause drift, but it can rename a recipe out
# from under the jobs below, so check they still resolve rather than
# regenerating everything.
- name: Check the recipes this workflow calls still resolve
run: |
just --list >/dev/null
for recipe in cfn-sort gen-fonts gen-yaml gen-radios; do
just --show "${recipe}" >/dev/null
done
# Skipped on workflow_dispatch, which has no base revision to diff
# against; the jobs below run unconditionally in that case.
- name: Filter changed paths
uses: dorny/paths-filter@v4
id: filter
if: github.event_name != 'workflow_dispatch'
with:
filters: |
cfn:
- '.github/workflows/codegen_drift.yml'
- '.github/actions/codegen_drift/action.yml'
- 'tools/cfn_sorter.sh'
- 'tools/cfn_sorter.cpp'
- 'tools/copyright-header.txt'
- 'radio/src/dataconstants.h'
- 'radio/src/cfn_sort.cpp'
- 'radio/src/translations/i18n/**'
fonts:
- '.github/workflows/codegen_drift.yml'
- '.github/actions/codegen_drift/action.yml'
- 'radio/src/fonts/**'
- 'radio/src/translations/i18n/**'
yaml:
- '.github/workflows/codegen_drift.yml'
- '.github/actions/codegen_drift/action.yml'
- 'tools/generate-yaml.sh'
- 'tools/build-common.sh'
- 'radio/src/myeeprom.h'
- 'radio/src/datastructs.h'
- 'radio/src/dataconstants.h'
- 'radio/src/storage/yaml/**'
- 'radio/util/generate_yaml.py'
- 'radio/util/yaml_parser.tmpl'
- 'radio/util/hw_defs/**'
- 'radio/src/boards/hw_defs/**'
radios:
- '.github/workflows/codegen_drift.yml'
- '.github/actions/codegen_drift/action.yml'
- 'fw.json'
- 'radio/src/boards/hw_defs/**'
- 'web/scripts/gen-radios-json.js'
- 'web/public/radios.json'
cfn-sort:
name: Custom function sort order
needs: changes
if: needs.changes.outputs.cfn == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 15
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
- ${{ github.workspace }}:/src
steps:
- name: Check out the repo
uses: actions/checkout@v7
with:
submodules: recursive
- name: Check for drift
uses: ./.github/actions/codegen_drift
with:
just-version: ${{ env.JUST_VERSION }}
recipe: cfn-sort
paths: radio/src/cfn_sort.cpp
label: Custom function sort order
fonts:
name: LVGL fonts
needs: changes
if: needs.changes.outputs.fonts == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
- ${{ github.workspace }}:/src
steps:
- name: Check out the repo
uses: actions/checkout@v7
with:
submodules: recursive
- name: Check for drift
uses: ./.github/actions/codegen_drift
with:
just-version: ${{ env.JUST_VERSION }}
recipe: gen-fonts
paths: radio/src/fonts/lvgl
label: LVGL fonts
yaml:
name: YAML parsers
needs: changes
if: needs.changes.outputs.yaml == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
- ${{ github.workspace }}:/src
steps:
- name: Check out the repo
uses: actions/checkout@v7
with:
submodules: recursive
- name: Check for drift
uses: ./.github/actions/codegen_drift
with:
just-version: ${{ env.JUST_VERSION }}
recipe: gen-yaml
paths: radio/src/storage/yaml
label: YAML parsers
radios:
name: Web simulator radio list
needs: changes
if: needs.changes.outputs.radios == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: ghcr.io/edgetx/edgetx-dev:latest
volumes:
- ${{ github.workspace }}:/src
steps:
- name: Check out the repo
uses: actions/checkout@v7
- name: Check for drift
uses: ./.github/actions/codegen_drift
with:
just-version: ${{ env.JUST_VERSION }}
recipe: gen-radios
paths: web/public/radios.json
label: Web simulator radio list