name: Test on: push: branches: - "**" tags-ignore: - "**" jobs: build: runs-on: ${{ matrix.operating-system }} strategy: matrix: operating-system: [ubuntu-22.04] php-versions: ["8.0", "8.1"] env: extensions: pcov, imagick tools: composer ini-values: precision=16, default_charset='UTF-8', pcov.directory=src key: cache-1626460452817 name: Test on PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }} steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup cache environment if: ${{ !env.ACT }} id: extcache uses: shivammathur/cache-extensions@v1 with: php-version: ${{ matrix.php-versions }} extensions: ${{ env.extensions }} key: ${{ env.key }} - name: Cache extensions if: ${{ !env.ACT }} uses: actions/cache@v3 with: path: ${{ steps.extcache.outputs.dir }} key: ${{ steps.extcache.outputs.key }} restore-keys: ${{ steps.extcache.outputs.key }} - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} extensions: ${{ env.extensions }} ini-values: ${{ env.ini-values }} coverage: pcov tools: ${{ env.tools }} env: fail-fast: true - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Validate composer run: composer validate working-directory: app - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install dependencies run: composer install --no-progress --ignore-platform-reqs working-directory: app - name: Run tests with phpunit run: app/vendor/bin/phpunit -c app/phpunit-report.xml --coverage-clover=app/build/coverage/clover.xml