zmk/.github/workflows/hardware-metadata-validation.yml
Joel Spadin 32ae776c42 refactor: Add more checks to pre-commit
Updated existing pre-commit hooks and added some new hooks:

- Remove trailing whitespace
- Ensure every non-empty file ends with a new line
- Check YAML file validity
- Prevent adding large files
- Ensure any scripts with shebangs are executable

Added a GitHub action to run pre-commit on every commit. Removed any
existing actions which duplicate pre-commit.

Ran pre-commit on the codebase.
2023-04-24 16:07:04 -07:00

35 lines
1.0 KiB
YAML

name: Hardware Metadata Validation
on:
push:
paths:
- ".github/workflows/hardware-metadata-validation.yml"
- "schema/hardware-metadata.schema.json"
- "app/boards/**/*.zmk.yml"
- "app/scripts/west_commands/metadata.py"
pull_request:
paths:
- ".github/workflows/hardware-metadata-validation.yml"
- "schema/hardware-metadata.schema.json"
- "app/boards/**/*.zmk.yml"
- "app/scripts/west_commands/metadata.py"
jobs:
validate-metadata:
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-dev-arm:3.2
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: pip install -r app/scripts/requirements.txt
- name: West init
run: west init -l app
- name: Update modules (west update)
run: west update
- name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export
- name: Validate Hardware Metadata
working-directory: app
run: west metadata check