Fix CodeQL actions analysis workflow #5
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: "Fast Forward Test Suite" | |
| on: | |
| push: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| workflow_dispatch: | |
| inputs: | |
| publish-required-statuses: | |
| description: Mirror required test matrix checks as commit statuses for workflow-dispatched runs. | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| statuses: write | |
| jobs: | |
| tests: | |
| name: Run Tests (${{ matrix.php-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.3" | |
| - "8.4" | |
| - "8.5" | |
| env: | |
| COMPOSER_ROOT_VERSION: ${{ github.event_name == 'pull_request' && format('dev-{0}', github.event.pull_request.head.ref) || 'dev-main' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| coverage: none | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Validate composer metadata | |
| run: composer validate --strict | |
| - name: Validate packaged payload | |
| run: | | |
| test -d .agents/agents | |
| test -d .agents/skills | |
| test -f .agents/agents/issue-implementer.md | |
| test -f .agents/skills/github-pull-request/SKILL.md | |
| php -r '$composer = json_decode(file_get_contents("composer.json"), true, flags: JSON_THROW_ON_ERROR); if (($composer["type"] ?? null) !== "fast-forward-resource-bundle") { exit(1); } if (($composer["extra"]["installer-name"] ?? null) !== "agents") { exit(1); } if (($composer["extra"]["fast-forward-bundle"]["installer-path"] ?? null) !== ".agents/{\$name}/") { exit(1); }' | |
| - name: Publish required test status | |
| if: ${{ always() && inputs.publish-required-statuses }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TARGET_SHA: ${{ github.sha }} | |
| TARGET_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| TEST_CONTEXT: Run Tests (${{ matrix.php-version }}) | |
| TEST_RESULT: ${{ job.status }} | |
| run: | | |
| if [ "${TEST_RESULT}" = "success" ]; then | |
| state="success" | |
| description="Workflow-dispatched package validation job passed." | |
| else | |
| state="failure" | |
| description="Workflow-dispatched package validation job result: ${TEST_RESULT}." | |
| fi | |
| gh api \ | |
| --method POST \ | |
| "repos/${GITHUB_REPOSITORY}/statuses/${TARGET_SHA}" \ | |
| -f state="${state}" \ | |
| -f context="${TEST_CONTEXT}" \ | |
| -f description="${description}" \ | |
| -f target_url="${TARGET_URL}" |