246 lines
7.7 KiB
YAML
246 lines
7.7 KiB
YAML
---
|
|
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'
|
|
# simulator string list
|
|
- 'radio/src/translations/simstr.m4'
|
|
- 'radio/src/translations/string_list.h'
|
|
- 'radio/src/translations/sim_string_list.h'
|
|
pull_request:
|
|
paths: *trigger-paths
|
|
workflow_dispatch:
|
|
|
|
# These jobs fail on drift so it's visible on the PR, but none of them are
|
|
# configured as required status checks - a contributor without the local
|
|
# toolchain can still merge.
|
|
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 }}
|
|
simstr: ${{ steps.filter.outputs.simstr }}
|
|
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 gen-simstr; 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'
|
|
simstr:
|
|
- '.github/workflows/codegen_drift.yml'
|
|
- '.github/actions/codegen_drift/action.yml'
|
|
- 'radio/src/translations/simstr.m4'
|
|
- 'radio/src/translations/string_list.h'
|
|
- 'radio/src/translations/sim_string_list.h'
|
|
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
recipe: gen-radios
|
|
paths: web/public/radios.json
|
|
label: Web simulator radio list
|
|
|
|
simstr:
|
|
name: Simulator string list
|
|
needs: changes
|
|
if: needs.changes.outputs.simstr == '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:
|
|
recipe: gen-simstr
|
|
paths: radio/src/translations/sim_string_list.h
|
|
label: Simulator string list
|