* refresh code and dependencies, migrate to cs fixer #52
Workflow file for this run
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: Check Build | |
on: [pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
php: ["8.1", "8.2"] | |
runs-on: ubuntu-latest | |
container: | |
image: eventjet/checks-${{ matrix.php }}:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Prepare environment | |
run: | | |
mkdir -p /root/.ssh | |
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts | |
echo "COMPOSER_CACHE=$(composer config cache-dir)" >> $GITHUB_ENV | |
git fetch origin $GITHUB_BASE_REF $GITHUB_HEAD_REF | |
echo "GIT_ADDED_FILES="$(git diff --name-only --diff-filter=A origin/$GITHUB_BASE_REF origin/$GITHUB_HEAD_REF | grep 'src\/')"" >> $GITHUB_ENV | |
- name: Composer Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.COMPOSER_CACHE }} | |
vendor | |
key: ${{ runner.os }}-composer | |
- name: Install dependencies | |
run: | | |
composer update --no-progress --no-interaction ${{ matrix.composer_args }} > /dev/null | |
- name: Static Analysis | |
run: | | |
composer check-deps | |
composer cs-check | |
composer phpstan -- --no-progress | |
composer psalm | |
- name: Infection coverage of changed lines | |
if: "!contains(github.event.pull_request.labels.*.name, 'skip-infection')" | |
run: | | |
git fetch origin $GITHUB_BASE_REF $GITHUB_HEAD_REF | |
vendor/bin/infection \ | |
--git-diff-base=origin/$GITHUB_BASE_REF \ | |
--git-diff-lines \ | |
--logger-github \ | |
--min-msi=100 \ | |
--min-covered-msi=100 \ | |
--ignore-msi-with-no-mutations \ | |
-jmax | |
- name: Save Infection result | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: infection-log-${{ matrix.php }}.txt | |
path: infection-log.txt | |
- name: PHPUnit | |
run: vendor/bin/phpunit --coverage-clover=coverage.xml --stop-on-failure | |
- name: Save Infection result | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: infection-log-${{ matrix.php }}.txt | |
path: infection-log.txt | |
- name: Monitor coverage | |
if: github.event_name == 'pull_request' | |
uses: slavcodev/coverage-monitor-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
coverage_path: "coverage.xml" | |
comment: false | |
comment_context: Coverage PHP ${{ matrix.php }} | |
status_context: Coverage PHP ${{ matrix.php }} | |
threshold_alert: 100 | |
threshold_warning: 100 |