Cleanup with performance gain #176
Workflow file for this run
This file contains hidden or 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
| # https://docs.github.com/en/actions | |
| name: "CI" | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "main" | |
| permissions: | |
| contents: "read" | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| cs: | |
| name: "Code Style" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v7" | |
| - name: "Setup PHP" | |
| uses: "shivammathur/setup-php@v2" | |
| with: | |
| php-version: "8.5" | |
| tools: "composer, cs2pr" | |
| - name: "Install dependencies" | |
| run: "composer install --no-interaction --prefer-dist" | |
| - name: "Run PHP_CodeSniffer" | |
| run: | | |
| set -o pipefail | |
| vendor/bin/phpcs -q --report=checkstyle | cs2pr | |
| stan: | |
| name: "Static Analysis" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v7" | |
| - name: "Setup PHP" | |
| uses: "shivammathur/setup-php@v2" | |
| with: | |
| php-version: "8.5" | |
| tools: "composer" | |
| - name: "Install dependencies" | |
| run: "composer install --no-interaction --prefer-dist" | |
| - name: "Run PHPStan" | |
| run: "vendor/bin/phpstan analyse --no-progress --error-format=github" | |
| tests: | |
| name: "Tests" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: "actions/checkout@v7" | |
| - name: "Setup PHP" | |
| uses: "shivammathur/setup-php@v2" | |
| with: | |
| php-version: "8.5" | |
| tools: "composer" | |
| coverage: "xdebug" | |
| - name: "Install dependencies" | |
| run: "composer install --no-interaction --prefer-dist" | |
| - run: "mkdir -p var/.phpunit.cache" | |
| - name: "Run PHPUnit (console)" | |
| run: "vendor/bin/phpunit --configuration phpunit.xml.dist --colors=always" | |
| - name: "Generate coverage summary" | |
| if: ${{ ! cancelled() }} | |
| run: | | |
| echo '```' > var/.phpunit.cache/coverage.txt | |
| vendor/bin/phpunit \ | |
| --configuration phpunit.xml.dist \ | |
| --colors=never \ | |
| --coverage-text >> var/.phpunit.cache/coverage.txt | |
| echo '```' >> var/.phpunit.cache/coverage.txt | |
| - name: "Report test results" | |
| uses: "mikepenz/action-junit-report@v6" | |
| if: ${{ ! cancelled() }} | |
| with: | |
| report_paths: "var/.phpunit.cache/junit.xml" | |
| annotate_only: true | |
| - name: "Post coverage summary" | |
| if: ${{ ! cancelled() }} | |
| run: 'cat var/.phpunit.cache/coverage.txt >> "$GITHUB_STEP_SUMMARY"' | |
| - name: "Upload coverage report" | |
| uses: "actions/upload-artifact@v7" | |
| if: ${{ ! cancelled() }} | |
| with: | |
| name: "coverage-report" | |
| path: | | |
| var/.phpunit.cache/coverage-html | |
| var/.phpunit.cache/coverage.xml | |
| var/.phpunit.cache/junit.xml | |
| retention-days: 7 |