|
| 1 | +name: "CI" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - "master" |
| 8 | + |
| 9 | +env: |
| 10 | + INI_VALUES: zend.assertions=1,error_reporting=-1 |
| 11 | + |
| 12 | +jobs: |
| 13 | + composer-json-lint: |
| 14 | + name: "Lint composer.json" |
| 15 | + runs-on: "ubuntu-latest" |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + php-version: |
| 19 | + - "8.1" |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: "actions/checkout@v3" |
| 23 | + - uses: "shivammathur/setup-php@v2" |
| 24 | + with: |
| 25 | + coverage: "none" |
| 26 | + php-version: "${{ matrix.php-version }}" |
| 27 | + ini-values: "${{ env.INI_VALUES }}" |
| 28 | + tools: composer-normalize,composer-require-checker,composer-unused |
| 29 | + - uses: "ramsey/composer-install@v2" |
| 30 | + |
| 31 | + - run: "composer validate --strict" |
| 32 | + - run: "composer-normalize --dry-run" |
| 33 | + - run: "composer-require-checker check --config-file=$(realpath composer-require-checker.json)" |
| 34 | + - run: "composer-unused" |
| 35 | + |
| 36 | + tests: |
| 37 | + name: "Tests" |
| 38 | + runs-on: "ubuntu-latest" |
| 39 | + strategy: |
| 40 | + matrix: |
| 41 | + php-version: |
| 42 | + - "8.2" |
| 43 | + code-coverage: |
| 44 | + - "none" |
| 45 | + include: |
| 46 | + - php-version: "8.1" |
| 47 | + code-coverage: "pcov" |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: "actions/checkout@v3" |
| 51 | + - uses: "shivammathur/setup-php@v2" |
| 52 | + with: |
| 53 | + coverage: "${{ matrix.code-coverage }}" |
| 54 | + php-version: "${{ matrix.php-version }}" |
| 55 | + ini-values: "${{ env.INI_VALUES }}" |
| 56 | + - uses: "ramsey/composer-install@v2" |
| 57 | + |
| 58 | + - run: "vendor/bin/phpunit --no-coverage --no-logging" |
| 59 | + if: ${{ matrix.code-coverage == 'none' }} |
| 60 | + timeout-minutes: 3 |
| 61 | + |
| 62 | + - run: "vendor/bin/phpunit --coverage-clover=coverage.xml --no-logging" |
| 63 | + if: ${{ matrix.code-coverage != 'none' }} |
| 64 | + timeout-minutes: 3 |
| 65 | + |
| 66 | + - name: "Send code coverage report to Codecov.io" |
| 67 | + if: ${{ matrix.code-coverage != 'none' }} |
| 68 | + uses: "codecov/codecov-action@v3" |
| 69 | + with: |
| 70 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 71 | + file: ./coverage.xml |
| 72 | + fail_ci_if_error: true |
| 73 | + |
| 74 | + coding-standards: |
| 75 | + name: "Coding Standards" |
| 76 | + runs-on: "ubuntu-latest" |
| 77 | + strategy: |
| 78 | + matrix: |
| 79 | + php-version: |
| 80 | + - "8.1" |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: "actions/checkout@v3" |
| 84 | + - uses: "shivammathur/setup-php@v2" |
| 85 | + with: |
| 86 | + coverage: "none" |
| 87 | + php-version: "${{ matrix.php-version }}" |
| 88 | + ini-values: "${{ env.INI_VALUES }}" |
| 89 | + - uses: "ramsey/composer-install@v2" |
| 90 | + |
| 91 | + - run: "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff" |
0 commit comments