Skip to content

bug

bug #7

Workflow file for this run

# https://docs.github.com/en/actions/using-workflows/reusing-workflows
name: Checks
on: pull_request
jobs:
analyse:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: dependencies
uses: php-actions/composer@v6
with:
php_version: 8.3
php_extensions: bcmath
- name: install tools
run: |
mkdir --parents tools/phpstan tools/phpunit
composer require phpstan/phpstan --working-dir=tools/phpstan --no-interaction --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
composer require phpunit/phpunit --working-dir=tools/phpunit --no-interaction --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: analyse
run: tools/phpstan/vendor/bin/phpstan --error-format=github --no-progress
cs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v4
- name: dependencies
uses: php-actions/composer@v6
with:
php_version: 8.3
php_extensions: zip gd bcmath
- name: install ecs
run: |
mkdir --parents tools/ecs tools/staabm
composer require easy-cs/easy-cs --working-dir=tools/ecs --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
composer require staabm/annotate-pull-request-from-checkstyle --working-dir=tools/staabm --no-interaction
- name: run checks
# run: tools/ecs/vendor/bin/ecs check --ansi --no-progress-bar
run: tools/ecs/vendor/bin/ecs check --ansi --no-progress-bar --output-format=checkstyle | tools/staabm/vendor/bin/cs2pr
- name: comment on failure
if: ${{ failure() && github.event_name == 'pull_request' }}
uses: actions/github-script@v7
with:
script: |
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const body = '❌ Our coding standards were not met.\nplease run\n```shell\ncomposer fix-cs\n```\nsee ' + url;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.4', '8.2', '8.3' ]
steps:
- uses: actions/checkout@v2
- name: dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
php_extensions: bcmath
- name: install phpunit
run: |
mkdir --parents tools/phpunit
composer require phpunit/phpunit --working-dir=tools/phpunit --no-interaction --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
# - name: Composer dependencies
# run: composer require phpunit/phpunit --dev --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: start server
run: composer start-server &
- name: configure matchers
uses: mheap/phpunit-matcher-action@v1
- name: run tests
run: tools/phpunit/vendor/bin/phpunit --coverage-text --teamcity tests
env:
XDEBUG_MODE: coverage