tools/lint-action-scripts.sh runs shellcheck and shfmt on actions/**/*.sh with pinned tools; validate-workflows.yml runs it, and .editorconfig sets the shell format. The tests show a shellcheck problem and a badly formatted script fail. Refs #187 Task: MIL-012#6
35 lines
929 B
YAML
35 lines
929 B
YAML
name: Validate workflows
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
validate:
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Check out the repository
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
- name: Create a virtual environment and install test dependencies
|
|
run: |
|
|
python3 -m venv .venv
|
|
.venv/bin/python -m pip install --quiet -r tests/requirements.txt
|
|
|
|
- name: Validate workflow files and run the offline tests under coverage
|
|
run: .venv/bin/python -m coverage run -m pytest -q tests
|
|
|
|
- name: Check the coverage of the tools
|
|
run: .venv/bin/python -m coverage report
|
|
|
|
- name: Lint the shell scripts of the actions
|
|
env:
|
|
SHELLCHECK: .venv/bin/shellcheck
|
|
SHFMT: .venv/bin/shfmt
|
|
run: bash tools/lint-action-scripts.sh actions
|