Work in progress #109
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: Run PHP Tests and Code Quality Tools | |
on: | |
push: | |
branches: [ project-website ] | |
pull_request: | |
branches: [ project-website ] | |
schedule: | |
# Also run every Sunday at midnight | |
- cron: '0 0 * * 0' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
php: [8.3] | |
# prefer-lowest is causing unit tests to fail when php 7.2 is run against PHPunit 7.x, | |
# PHPUnit 8.x is the latest stable release that supports PHP 7.2 and that runs fine | |
# dependency-version: [prefer-lowest, prefer-stable] | |
dependency-version: [prefer-stable] | |
os: [ubuntu-latest] | |
# include: | |
# - os: ubuntu-20.04 | |
# php: 8.1 | |
# - os: ubuntu-20.04 | |
# php: 8.2 | |
# - os: ubuntu-22.04 | |
# php: 8.2 | |
#exclude: | |
#- os: ubuntu-20.04 | |
#php: 7.3 | |
name: PHP-${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# | |
# - name: Setup PHP | |
# uses: shivammathur/setup-php@v2 | |
# with: | |
# php-version: ${{ matrix.php }} | |
# ini-values: pcre.jit=0, pcre.backtrack_limit=9999999, pcre.recursion_limit=9999999 | |
# coverage: xdebug | |
# | |
# - name: PHP version | |
# run: php -v | |
# | |
# - name: Composer version | |
# run: composer --version | |
# | |
# - name: Validate composer.json and composer.lock | |
# run: composer validate | |
# | |
# - name: Install Dependencies | |
# run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress | |
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | |
# Docs: https://getcomposer.org/doc/articles/scripts.md | |
# - name: Run PHPUnit Test Suite | |
# run: vendor/bin/phpunit | |
# - name: Upload coverage results to Coveralls | |
# env: | |
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: | | |
# vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v | |
# | |
# - name: Run Rector | |
# # Run rector for PHP 7.X but not 8.0, rector is currently blowing up with PHP 8.0 | |
# if: matrix.php == '7.4' | |
# run: vendor/bin/rector process src --dry-run | |
# | |
# - name: Run Psalm | |
# # Run psalm for PHP 7.4 & 8.0 but not 7.2 & 7.3, psalm is currently blowing up with PHP 7.2 & 7.3 | |
# #if: matrix.php != '7.2' && matrix.php != '7.3' | |
# run: vendor/bin/psalm |