Skip to content

Update GitHub Actions #75

Update GitHub Actions

Update GitHub Actions #75

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
php-matrix:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.php-matrix.outputs.matrix }}
constraint: ${{ fromJSON(steps.php-matrix.outputs.matrix).constraint }}
versions: ${{ toJSON(fromJSON(steps.php-matrix.outputs.matrix).versions) }}
lowest: ${{ fromJSON(steps.php-matrix.outputs.matrix).lowest }}
highest: ${{ fromJSON(steps.php-matrix.outputs.matrix).highest }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: composer.json
sparse-checkout-cone-mode: false
- uses: typisttech/php-matrix-action@main
id: php-matrix
pest:
runs-on: ubuntu-latest
needs: php-matrix
strategy:
matrix:
php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
dependency-versions: [lowest, highest]
coverage: [none]
exclude:
- php: ${{ needs.php-matrix.outputs.highest }}
dependency-versions: highest
coverage: none
include:
- php: ${{ needs.php-matrix.outputs.highest }}
dependency-versions: highest
coverage: xdebug
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependency-versions }}
composer-options: --no-audit --optimize-autoloader
- run: composer pest:unit -- --ci --coverage-clover coverage.xml
if: ${{ matrix.coverage == 'xdebug' }}
- run: composer pest:unit -- --ci
if: ${{ matrix.coverage != 'xdebug' }}
- run: composer pest:feature -- --ci
- run: composer pest:e2e -- --ci
- uses: actions/upload-artifact@v4
if: ${{ matrix.coverage == 'xdebug' }}
with:
name: coverage
path: coverage.xml
codecov:
needs: pest
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: coverage
- uses: codecov/codecov-action@v5
with:
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}