Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
grummbeer committed Aug 4, 2024
1 parent 967f815 commit e58589e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 47 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/analyse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Analyse
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
31 changes: 9 additions & 22 deletions .github/workflows/cs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: coding standards
on: [pull_request]
# on: [push, pull_request] # runs twice
name: Coding Standards
on: pull_request
jobs:
check:
cs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -16,25 +15,13 @@ jobs:
php_version: 8.3
php_extensions: zip gd bcmath

- name: install tools
run: composer install-tools
- name: install ecs
run:
mkdir --parents tools/ecs
composer require easy-cs/easy-cs --working-dir=tools/ecs --no-interaction --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist

# - name: check
# # --diff-filter=d ignore deleted files
# # run: composer cs -- $(echo $(git diff --diff-filter=d --name-only "$COMMIT_RANGE"))
# run: composer cs
# env:
# COMMIT_RANGE: "${{ github.event.before }}...${{ github.event.after }}"

- name: start server
# run: php -S localhost:4444 -t public &
run: composer start-server &

- name: run tools
run: composer ci
env:
XDEBUG_MODE: coverage
PHPSTAN_ERROR_FORMAT: --error-format=github
- name: run checks
run: tools/ecs/vendor/bin/ecs check --ansi --no-progress-bar

- name: comment on failure
if: ${{ failure() && github.event_name == 'pull_request' }}
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/phpunit.yaml

This file was deleted.

25 changes: 13 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
name: Test
on: [pull_request]
# on: [push, pull_request] # runs twice
on: pull_request
jobs:
test:
tests:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/checkout@v2

- name: dependencies
uses: php-actions/composer@v6
with:
php_version: 8.3
php_extensions: zip gd bcmath
php_extensions: bcmath

- name: install tools
run: composer install-tools
- 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: add printer
run: composer require --dev mheap/phpunit-github-actions-printer
# - 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 --printer mheap\\GithubActionsReporter\\Printer tests
run: tools/phpunit/vendor/bin/phpunit --teamcity tests
env:
XDEBUG_MODE: coverage

0 comments on commit e58589e

Please sign in to comment.