* breaking out tests for easier usage * refactoring codebase * Added verification for properly formatted slug and fixed definitions that were incorrect * Adding new test case to ensure the file name matches either the slug or the part_number * fixed file names to match proper formatting * Adding test for annotating failures
33 lines
960 B
YAML
33 lines
960 B
YAML
---
|
|
name: Validate definitions
|
|
on: # yamllint disable-line rule:truthy
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
- name: Lint YAML files
|
|
run: |
|
|
yamllint --format github --strict \
|
|
device-types/ module-types/
|
|
- name: Format YAML files (hooks)
|
|
run: |
|
|
pre-commit run --config .pre-commit-hooks-config.yaml --all-files
|
|
- name: Format YAML files (yamlfmt)
|
|
run: |
|
|
pre-commit run --config .pre-commit-yamlfmt-config.yaml --all-files
|
|
- name: Install plugin
|
|
run: pip install pytest-github-actions-annotate-failures
|
|
- name: Run tests
|
|
id: pytest
|
|
run: pytest --tb=short -v
|