gh actions coverage setup - only build for the latest php version #5
This file contains 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: 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 GitHub Actions / PHP ComposerInvalid workflow file
|
||
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 |