|
| 1 | +name: "Continuous Integration" |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +env: |
| 8 | + COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist --no-suggest" |
| 9 | + |
| 10 | +jobs: |
| 11 | + tests: |
| 12 | + name: "Tests" |
| 13 | + runs-on: "ubuntu-latest" |
| 14 | + continue-on-error: ${{ matrix.experimental }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + dependencies: |
| 19 | + - "lowest" |
| 20 | + - "highest" |
| 21 | + php-version: |
| 22 | + - "8.2" |
| 23 | + - "8.3" |
| 24 | + - "8.4" |
| 25 | + experimental: |
| 26 | + - false |
| 27 | + include: |
| 28 | + - php-version: "8.5" |
| 29 | + composer-options: "--ignore-platform-reqs" |
| 30 | + experimental: true |
| 31 | + dependencies: "highest" |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: "Set up PHP" |
| 35 | + uses: "shivammathur/setup-php@v2" |
| 36 | + with: |
| 37 | + coverage: "none" |
| 38 | + php-version: "${{ matrix.php-version }}" |
| 39 | + extensions: "ds" |
| 40 | + tools: "composer:v2" |
| 41 | + |
| 42 | + - name: "Checkout" |
| 43 | + uses: "actions/checkout@v4" |
| 44 | + |
| 45 | + - name: "Install lowest dependencies" |
| 46 | + if: ${{ matrix.dependencies == 'lowest' }} |
| 47 | + run: "composer update --prefer-lowest ${{ env.COMPOSER_FLAGS }} ${{ matrix.composer-options }}" |
| 48 | + |
| 49 | + - name: "Install highest dependencies" |
| 50 | + if: ${{ matrix.dependencies == 'highest' }} |
| 51 | + run: "composer update ${{ env.COMPOSER_FLAGS }} ${{ matrix.composer-options }}" |
| 52 | + |
| 53 | + - name: "Run tests" |
| 54 | + run: "./vendor/bin/phpunit -c phpunit.xml.dist" |
| 55 | + |
| 56 | + cs: |
| 57 | + name: "Codestyle check on PHP 8.2" |
| 58 | + runs-on: "ubuntu-latest" |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: "Set up PHP" |
| 62 | + uses: "shivammathur/setup-php@v2" |
| 63 | + with: |
| 64 | + php-version: "8.2" |
| 65 | + extensions: "ds" |
| 66 | + tools: "composer:v2" |
| 67 | + |
| 68 | + - name: "Checkout code" |
| 69 | + uses: "actions/checkout@v4" |
| 70 | + |
| 71 | + - name: "Download dependencies" |
| 72 | + run: "composer update ${{ env.COMPOSER_FLAGS }}" |
| 73 | + |
| 74 | + - name: "Check codestyle" |
| 75 | + run: "./vendor/bin/phpcs -n --standard=vendor/stefna/codestyle/library.xml src/ tests/" |
| 76 | + |
| 77 | + static-analysis: |
| 78 | + name: "Static analysis" |
| 79 | + runs-on: "ubuntu-latest" |
| 80 | + strategy: |
| 81 | + matrix: |
| 82 | + php-version: |
| 83 | + - "8.2" |
| 84 | + |
| 85 | + steps: |
| 86 | + - name: "Set up PHP" |
| 87 | + uses: "shivammathur/setup-php@v2" |
| 88 | + with: |
| 89 | + coverage: "none" |
| 90 | + php-version: "${{ matrix.php-version }}" |
| 91 | + extensions: "ds" |
| 92 | + tools: "composer:v2" |
| 93 | + |
| 94 | + - name: "Checkout" |
| 95 | + uses: "actions/checkout@v4" |
| 96 | + |
| 97 | + - name: "Install latest dependencies" |
| 98 | + run: "composer update ${{ env.COMPOSER_FLAGS }}" |
| 99 | + |
| 100 | + - name: "Run PHPStan" |
| 101 | + run: "vendor/bin/phpstan analyse" |
0 commit comments