Add HTTP multi-method routes API #15
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: Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| packages: | |
| description: 'Space-separated package names (default: all)' | |
| required: false | |
| default: '' | |
| jobs: | |
| changed: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.changed.outputs.packages }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - id: changed | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| CHANGED="${{ inputs.packages }}" | |
| [ -n "$CHANGED" ] || CHANGED=$(ls packages) | |
| else | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| RANGE="origin/${{ github.base_ref }}...HEAD" | |
| elif git rev-parse -q --verify "${{ github.event.before }}" > /dev/null; then | |
| RANGE="${{ github.event.before }}..HEAD" | |
| else | |
| RANGE="HEAD~1..HEAD" | |
| fi | |
| CHANGED=$(git diff --name-only "$RANGE" -- packages/ | cut -d/ -f2) | |
| fi | |
| PACKAGES=$(echo "$CHANGED" | tr ' ' '\n' | sort -u \ | |
| | while read -r package; do [ -d "packages/$package" ] && echo "$package"; done \ | |
| | jq --raw-input . | jq --compact-output --slurp .) | |
| echo "packages=$PACKAGES" >> "$GITHUB_OUTPUT" | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - run: bin/monorepo validate | |
| test: | |
| needs: changed | |
| if: needs.changed.outputs.packages != '[]' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJson(needs.changed.outputs.packages) }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - id: meta | |
| run: | | |
| EXTENSIONS=$(jq -r '[(.require, ."require-dev", .suggest | select(. != null)) | keys[] | select(startswith("ext-")) | ltrimstr("ext-")] | unique | join(", ")' packages/${{ matrix.package }}/composer.json) | |
| echo "extensions=$EXTENSIONS" >> "$GITHUB_OUTPUT" | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: ${{ steps.meta.outputs.extensions }} | |
| - run: bin/monorepo check ${{ matrix.package }} | |
| - run: bin/monorepo test ${{ matrix.package }} |