Skip to content

gh actions coverage setup - only build for the latest php version #5

gh actions coverage setup - only build for the latest php version

gh actions coverage setup - only build for the latest php version #5

Workflow file for this run

name: PHP Composer
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- "8.2"
- "8.3"
dependency-versions:
- "lowest"
- "highest"
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependency-versions }}
- name: Run test-suite
run: composer run-script phpunit
- name: Setup Pages
if: ${{ github.ref == 'refs/heads/main' && matrix.php-version == '8.3' && matrix.dependency-versions == 'highest' }}
id: pages
uses: actions/configure-pages@v3
- name: Upload artifact
if: ${{ github.ref == 'refs/heads/main' && matrix.php-version == '8.3' && matrix.dependency-versions == 'highest' }}
uses: actions/upload-pages-artifact@v2
with:
path: ./coverage/html
deploy:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' && matrix.php-version == '8.3' && matrix.dependency-versions == 'highest' }}

Check failure on line 64 in .github/workflows/phpunit.yml

View workflow run for this annotation

GitHub Actions / PHP Composer

Invalid workflow file

The workflow is not valid. .github/workflows/phpunit.yml (Line: 64, Col: 10): Unrecognized named-value: 'matrix'. Located at position 36 within expression: github.ref == 'refs/heads/main' && matrix.php-version == '8.3' && matrix.dependency-versions == 'highest'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2