|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'master' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '*' |
| 10 | + |
| 11 | +jobs: |
| 12 | + phpunit: |
| 13 | + runs-on: ubuntu-22.04 |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + php-version: ['8.1', '8.3'] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v1 |
| 21 | + with: |
| 22 | + fetch-depth: 1 |
| 23 | + |
| 24 | + - name: Setup PHP |
| 25 | + uses: shivammathur/setup-php@v2 |
| 26 | + with: |
| 27 | + php-version: ${{ matrix.php-version }} |
| 28 | + extensions: curl, mbstring, intl, pdo_sqlite |
| 29 | + coverage: pcov |
| 30 | + |
| 31 | + - name: composer install |
| 32 | + run: | |
| 33 | + if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then |
| 34 | + composer install --no-progress --prefer-lowest --prefer-stable --ignore-platform-req=php |
| 35 | + else |
| 36 | + composer install --no-progress --ignore-platform-req=php |
| 37 | + fi |
| 38 | +
|
| 39 | + - name: Run PHPUnit |
| 40 | + run: | |
| 41 | + if [[ ${{ matrix.php-version }} == '8.3' ]]; then |
| 42 | + export CODECOVERAGE=1 && vendor/bin/phpunit --coverage-clover=coverage.xml |
| 43 | + else |
| 44 | + vendor/bin/phpunit |
| 45 | + fi |
| 46 | +
|
| 47 | + - name: Submit code coverage |
| 48 | + if: matrix.php-version == '8.3' |
| 49 | + uses: codecov/codecov-action@v4 |
| 50 | + with: |
| 51 | + flags: phpunit |
| 52 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 53 | + |
| 54 | + cs-stan: |
| 55 | + name: Coding Standard & Static Analysis |
| 56 | + runs-on: ubuntu-22.04 |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v1 |
| 59 | + with: |
| 60 | + fetch-depth: 1 |
| 61 | + |
| 62 | + - name: Setup PHP |
| 63 | + uses: shivammathur/setup-php@v2 |
| 64 | + with: |
| 65 | + php-version: '8.3' |
| 66 | + extensions: mbstring, intl |
| 67 | + coverage: none |
| 68 | + tools: phive |
| 69 | + |
| 70 | + - name: composer install |
| 71 | + run: composer install --no-progress --ignore-platform-req=php |
| 72 | + |
| 73 | + - name: Install PHP tools with phive. |
| 74 | + run: phive install --trust-gpg-keys '12CE0F1D262429A5' |
| 75 | + |
| 76 | + - name: Run PHP CodeSniffer |
| 77 | + run: vendor/bin/phpcs src/ tests/ |
| 78 | + |
| 79 | + - name: Run psalm |
| 80 | + if: success() || failure() |
| 81 | + run: tools/psalm --output-format=github |
0 commit comments