This repository has been archived by the owner on May 18, 2024. It is now read-only.
docs: add notice for new repository #122
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: PHPUnit | |
on: | |
pull_request: | |
branches: | |
- develop | |
push: | |
branches: | |
- develop | |
jobs: | |
main: | |
name: PHP ${{ matrix.php-versions }} Unit Tests | |
strategy: | |
matrix: | |
php-versions: ['7.3', '7.4', '8.0'] | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: composer, pecl, phpunit | |
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 | |
coverage: xdebug | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v2 | |
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 --no-interaction --prefer-dist --optimize-autoloader | |
env: | |
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} | |
- name: Enable Tachycardia | |
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV | |
- name: Test with PHPUnit | |
run: vendor/bin/phpunit --verbose --coverage-text | |
env: | |
TERM: xterm-256color | |
- if: matrix.php-versions == '8.0' | |
name: Mutate with Infection | |
run: | | |
composer global require infection/infection | |
git fetch --depth=1 origin $GITHUB_BASE_REF | |
infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations | |
- if: matrix.php-versions == '8.0' | |
name: Run Coveralls | |
run: vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} | |
coveralls: | |
needs: [main] | |
name: Coveralls Finished | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload Coveralls results | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |