Update github workflow actions #98
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
| name: CI | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| pull_request: | |
| branches: [ 'main' ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| code-style: | |
| name: Code style | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.3' ] | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| tools: composer:v2 | |
| - name: Check PHP Version | |
| run: php -v | |
| - name: Update dependencies with composer | |
| run: composer update --no-interaction --no-ansi --no-progress | |
| - name: Load ECS Cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: /tmp/ecs | |
| key: ${{ runner.os }}-ecs-${{ github.run_id }} | |
| restore-keys: ${{ runner.os }}-ecs- | |
| - name: Create cache directory | |
| run: mkdir -p /tmp/ecs | |
| - name: Run ECS | |
| run: ./vendor/bin/ecs --config=ecs.php check | |
| code-quality: | |
| name: Code quality | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.3' ] | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| tools: composer:v2 | |
| - name: Check PHP Version | |
| run: php -v | |
| - name: Update dependencies with composer | |
| run: composer update --no-interaction --no-ansi --no-progress | |
| - name: Load Rector Cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: /tmp/rector | |
| key: ${{ runner.os }}-rector-${{ github.run_id }} | |
| restore-keys: ${{ runner.os }}-rector- | |
| - name: Create cache directory | |
| run: mkdir -p /tmp/rector | |
| - name: Run Rector | |
| run: ./vendor/bin/rector --config=rector.php process --dry-run | |
| static-analysis: | |
| name: Static analysis (PHPStan) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.3' ] | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| tools: composer:v2 | |
| - name: Check PHP Version | |
| run: php -v | |
| - name: Update dependencies with composer | |
| run: composer update --no-interaction --no-ansi --no-progress | |
| - name: Load PHPStan Cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: /tmp/phpstan | |
| key: ${{ runner.os }}-phpstan-${{ github.run_id }} | |
| restore-keys: ${{ runner.os }}-phpstan- | |
| - name: Create cache directory | |
| run: mkdir -p /tmp/phpstan | |
| - name: Run PHPStan | |
| run: ./vendor/bin/phpstan analyze --configuration phpstan.neon | |
| unit-tests: | |
| name: Unit tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.3', '8.4' ] | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| tools: composer:v2 | |
| - name: Check PHP Version | |
| run: php -v | |
| - name: Update dependencies with composer | |
| run: composer update --no-interaction --no-ansi --no-progress | |
| - name: Run PHPUnit | |
| run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-clover ./coverage.xml | |
| # - name: Upload coverage reports to Codecov | |
| # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 | |
| # with: | |
| # files: ./coverage.xml | |
| # verbose: true | |
| # token: ${{ secrets.CODECOV_TOKEN }} |