refine workflow #47
Workflow file for this run
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: Staging Gate test | |
| on: | |
| pull_request: | |
| paths: | |
| - 'staging/**' | |
| - 'tools/**' | |
| jobs: | |
| gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fail if staging folder is missing or empty | |
| run: | | |
| if [ ! -d staging ] || [ -z "$(ls -A staging)" ]; then | |
| echo "::error ::staging folder is missing or empty. Please add or update at least one module." | |
| exit 1 | |
| fi | |
| - name: Staging compatibility check | |
| run: bash tools/02_validate_module.sh | |
| - name: Run all tools and report pass/fail | |
| run: | | |
| status=0 | |
| for tool in tools/[0-9][0-9]_*.sh; do | |
| # Skip 02_validate_module.sh (already run) | |
| if [[ "$(basename "$tool")" == "02_validate_module.sh" ]]; then | |
| continue | |
| fi | |
| echo "=== Running: $tool ===" | |
| bash "$tool" | |
| result=$? | |
| if [[ $result -eq 0 ]]; then | |
| echo "::notice ::PASS: $tool" | |
| else | |
| echo "::error ::FAIL: $tool (exit code $result)" | |
| status=1 | |
| fi | |
| echo | |
| done | |
| exit $status |