|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + |
| 7 | + tests: |
| 8 | + name: Tests |
| 9 | + runs-on: ubuntu-latest |
| 10 | + env: |
| 11 | + MOCKSERVER_URL: 'http://localhost:1080' |
| 12 | + services: |
| 13 | + mockserver: |
| 14 | + image: mockserver/mockserver |
| 15 | + ports: |
| 16 | + - "1080:1080" |
| 17 | + env: |
| 18 | + MOCKSERVER_INITIALIZATION_JSON_PATH: /docker/mockserver/expectations/**.json |
| 19 | + MOCKSERVER_LOG_LEVEL: WARN |
| 20 | + continue-on-error: ${{ matrix.experimental }} |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + dependencies: |
| 25 | + - "lowest" |
| 26 | + - "highest" |
| 27 | + php: |
| 28 | + - '7.4' |
| 29 | + - '8.0' |
| 30 | + experimental: |
| 31 | + - false |
| 32 | + include: |
| 33 | + - php: "8.1" |
| 34 | + composer-options: "--ignore-platform-reqs" |
| 35 | + experimental: true |
| 36 | + dependencies: "highest" |
| 37 | + - php: "8.2" |
| 38 | + composer-options: "--ignore-platform-reqs" |
| 39 | + experimental: true |
| 40 | + dependencies: "highest" |
| 41 | + steps: |
| 42 | + - name: Set up PHP |
| 43 | + uses: shivammathur/setup-php@2.24.0 |
| 44 | + with: |
| 45 | + php-version: ${{ matrix.php }} |
| 46 | + extensions: intl, mbstring |
| 47 | + tools: "composer:v2" |
| 48 | + |
| 49 | + - name: Checkout code |
| 50 | + uses: actions/checkout@v2 |
| 51 | + |
| 52 | + - name: "Install lowest dependencies" |
| 53 | + if: ${{ matrix.dependencies == 'lowest' }} |
| 54 | + run: composer update --prefer-lowest --no-interaction --no-progress --no-suggest ${{ matrix.composer-options }} |
| 55 | + |
| 56 | + - name: "Install highest dependencies" |
| 57 | + if: ${{ matrix.dependencies == 'highest' }} |
| 58 | + run: composer update --no-interaction --no-progress --no-suggest ${{ matrix.composer-options }} |
| 59 | + |
| 60 | + - name: "Run unit tests" |
| 61 | + run: ./vendor/bin/phpunit -c phpunit.xml |
| 62 | + |
| 63 | + cs: |
| 64 | + name: Codestyle check on PHP 7.4 |
| 65 | + runs-on: ubuntu-latest |
| 66 | + steps: |
| 67 | + - name: Set up PHP |
| 68 | + uses: shivammathur/setup-php@2.24.0 |
| 69 | + with: |
| 70 | + php-version: 7.4 |
| 71 | + |
| 72 | + - name: Checkout code |
| 73 | + uses: actions/checkout@v2 |
| 74 | + |
| 75 | + - name: Download dependencies |
| 76 | + run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable |
| 77 | + |
| 78 | + - name: Run tests |
| 79 | + run: ./vendor/bin/phpcs |
| 80 | + |
| 81 | + static-analysis: |
| 82 | + name: Static analysis |
| 83 | + runs-on: ubuntu-latest |
| 84 | + strategy: |
| 85 | + matrix: |
| 86 | + php: |
| 87 | + - '7.4' |
| 88 | + steps: |
| 89 | + - name: Set up PHP |
| 90 | + uses: shivammathur/setup-php@2.24.0 |
| 91 | + with: |
| 92 | + php-version: ${{ matrix.php }} |
| 93 | + |
| 94 | + - name: Checkout code |
| 95 | + uses: actions/checkout@v2 |
| 96 | + |
| 97 | + - name: Download dependencies |
| 98 | + run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable |
| 99 | + |
| 100 | + - name: Run PHPStan |
| 101 | + run: ./vendor/bin/phpstan analyse --memory-limit 512M |
0 commit comments