Integration tests #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Workflow YAML check | |
# Note that without this, a single minor mistake in a workflow YAML | |
# will cause github to SILENTLY FAIL. It will: | |
# - Not run any part of the workflow | |
# - Not even report that there was an error in the file | |
# This could cause a key set of checks to not run, and thus an important | |
# error to slip by unnoticed. | |
# TODO: It would be nice to validate the semantics of the workflow files | |
# not just their basic syntax, but this is a good start. | |
# e.g. if a job has a "needs:" field but nothing listed under it, | |
# that will pass linting, but fail at GH. I believe there's a GH API | |
# we can post to that will validate the workflow files. | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/*.yaml' | |
- '.github/.yamllint.yaml' | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/*.yaml' | |
- '.github/.yamllint.yaml' | |
jobs: | |
check-workflow-files: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: .github/workflows | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install yamllint | |
run: | | |
python -m pip install --upgrade pip | |
pip install yamllint | |
- name: Run yamllint | |
run: yamllint -c ../.yamllint.yaml *.yaml |