Bump shivammathur/setup-php from 2.37.0 to 2.37.1 in /.github/workflows #18
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 and Checks | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| jobs: | |
| php-matrix: | |
| name: Resolve PHP matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| versions: ${{ steps.php-matrix.outputs.versions }} | |
| steps: | |
| - name: Checkouting code... | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: composer.json | |
| sparse-checkout-cone-mode: false | |
| - name: Installing PHP... | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Create php-matrix composer file... | |
| shell: bash | |
| run: | | |
| package_constraint=$(php -r 'echo json_decode(file_get_contents("composer.json"), true)["require"]["clean/phpdoc-md"];') | |
| php_constraint=$(composer show clean/phpdoc-md "$package_constraint" --all --format=json | php -r '$pkg = json_decode(stream_get_contents(STDIN), true); echo $pkg["requires"]["php"];') | |
| php -r 'file_put_contents("composer.php-matrix.json", json_encode(["require" => ["php" => $argv[1]]], JSON_UNESCAPED_SLASHES));' "$php_constraint" | |
| - name: Generating PHP matrix... | |
| id: php-matrix | |
| uses: typisttech/php-matrix-action@v2 | |
| with: | |
| composer-json: composer.php-matrix.json | |
| source: php.net | |
| test: | |
| name: Test (PHP ${{ matrix.php }}) | |
| needs: | |
| - php-matrix | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| max-parallel: 5 | |
| matrix: | |
| php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} | |
| steps: | |
| - name: Checkouting code... | |
| uses: actions/checkout@v6 | |
| - name: Detecting Composer major... | |
| id: composer-major | |
| env: | |
| PHP_VERSION: ${{ matrix.php }} | |
| shell: bash | |
| run: | | |
| case "$PHP_VERSION" in | |
| 5.*|7.0|7.1|7.2|7.3) | |
| echo "value=v1" >> "$GITHUB_OUTPUT" | |
| ;; | |
| *) | |
| echo "value=v2" >> "$GITHUB_OUTPUT" | |
| ;; | |
| esac | |
| - name: Skipping tests for Composer v1 runtimes... | |
| if: ${{ steps.composer-major.outputs.value == 'v1' }} | |
| run: echo "Skipping PHP ${{ matrix.php }} because Composer v1 is EOL and unsupported by Packagist." | |
| - name: Installing PHP... | |
| if: ${{ steps.composer-major.outputs.value == 'v2' }} | |
| uses: shivammathur/setup-php@2.37.1 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: curl, gd, json, mbstring, pcre, session | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Setup BATS | |
| if: ${{ steps.composer-major.outputs.value == 'v2' }} | |
| uses: mig4/setup-bats@v1 | |
| with: | |
| bats-version: 1.8.2 | |
| - name: Test | |
| if: ${{ steps.composer-major.outputs.value == 'v2' }} | |
| run: bats tests |