Workflow Validation #1369
This file contains hidden or 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 Validation | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/**' | |
| - 'Makefile' | |
| - 'makefiles/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/**' | |
| - 'Makefile' | |
| - 'makefiles/**' | |
| jobs: | |
| config: | |
| name: Get Configuration | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| default-python-version: ${{ steps.config.outputs.default-python-version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Get project configuration | |
| id: config | |
| uses: ./.github/actions/get-config | |
| setup-cache: | |
| name: Setup Cache | |
| needs: config | |
| uses: ./.github/workflows/cache-management.yml | |
| with: | |
| cache-type: dependencies | |
| cache-key-base: workflow-validation | |
| python-version: ${{ needs.config.outputs.default-python-version }} | |
| validate-workflows: | |
| name: Validate Workflow Files | |
| runs-on: ubuntu-latest | |
| needs: [config, setup-cache] | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Python and UV | |
| uses: ./.github/actions/setup-uv-cached | |
| with: | |
| cache-key: ${{ needs.setup-cache.outputs.cache-key }} | |
| fail-on-cache-miss: false | |
| - name: Validate workflow syntax and logic | |
| run: | | |
| make validate-workflow-syntax | |
| - name: Validate workflows with actionlint | |
| run: | | |
| echo "::add-matcher::.github/actionlint-matcher.json" | |
| pip install actionlint-py | |
| actionlint .github/workflows/*.yml | |
| shell: bash | |
| - name: Validate shell scripts with shellcheck | |
| uses: ludeeus/action-shellcheck@2.0.0 | |
| with: | |
| ignore_paths: '.venv .git __pycache__ node_modules' |