|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + testsuite: |
| 7 | + name: Unittests |
| 8 | + runs-on: ubuntu-20.04 |
| 9 | + |
| 10 | + env: |
| 11 | + DB_HOST: 127.0.0.1 |
| 12 | + DB_DATABASE: test |
| 13 | + DB_USER: test |
| 14 | + DB_ROOT_PASSWORD: changeme |
| 15 | + DB_PASSWORD: changeme |
| 16 | + REDIS_SCHEME: tcp |
| 17 | + REDIS_HOST: 127.0.0.1 |
| 18 | + REDIS_PORT: 6379 |
| 19 | + |
| 20 | + services: |
| 21 | + mariadb: |
| 22 | + image: mariadb:latest |
| 23 | + ports: |
| 24 | + - 3306:3306 |
| 25 | + env: |
| 26 | + DATABASE_HOST: 127.0.0.1 |
| 27 | + MARIADB_DATABASE: test |
| 28 | + MARIADB_USER: test |
| 29 | + MARIADB_ROOT_PASSWORD: changeme |
| 30 | + MARIADB_PASSWORD: changeme |
| 31 | + options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 32 | + redis: |
| 33 | + image: redis |
| 34 | + options: >- |
| 35 | + --health-cmd "redis-cli ping" |
| 36 | + --health-interval 10s |
| 37 | + --health-timeout 5s |
| 38 | + --health-retries 5 |
| 39 | + ports: |
| 40 | + - 6379:6379 |
| 41 | + |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + php-version: ['8.2', '8.3'] |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + with: |
| 50 | + fetch-depth: 1 |
| 51 | + |
| 52 | + - name: Setup PHP |
| 53 | + uses: shivammathur/setup-php@v2 |
| 54 | + with: |
| 55 | + php-version: ${{ matrix.php-version }} |
| 56 | + extensions: json, fileinfo |
| 57 | + tools: pecl |
| 58 | + coverage: pcov |
| 59 | + |
| 60 | + - name: Composer install |
| 61 | + run: | |
| 62 | + if [[ ${{ matrix.prefer-lowest == 'prefer-lowest' }} ]]; then |
| 63 | + composer update --prefer-lowest --prefer-stable |
| 64 | + else |
| 65 | + composer install |
| 66 | + fi |
| 67 | +
|
| 68 | + - name: Run PHPUnit |
| 69 | + run: | |
| 70 | + if [[ ${{ matrix.php-version }} == '8.2' ]]; then |
| 71 | + bin/phpunit --coverage-clover=coverage.xml |
| 72 | + else |
| 73 | + bin/phpunit |
| 74 | + fi |
| 75 | + - name: Code Coverage Report |
| 76 | + if: success() && matrix.php-version == '8.2' |
| 77 | + uses: codecov/codecov-action@v4 |
| 78 | + |
| 79 | + - name: Run Infection |
| 80 | + run: | |
| 81 | + if [[ ${{ matrix.php-version }} == '8.2' ]]; then |
| 82 | + bin/infection |
| 83 | + fi |
| 84 | +
|
| 85 | + cs-stan: |
| 86 | + name: Coding Standard & Static Analysis |
| 87 | + runs-on: ubuntu-20.04 |
| 88 | + |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + with: |
| 92 | + fetch-depth: 1 |
| 93 | + |
| 94 | + - name: Setup PHP |
| 95 | + uses: shivammathur/setup-php@v2 |
| 96 | + with: |
| 97 | + php-version: ${{ matrix.php-version }} |
| 98 | + extensions: json, fileinfo |
| 99 | + coverage: pcov |
| 100 | + tools: pecl |
| 101 | + |
| 102 | + - name: Composer install |
| 103 | + run: composer update --prefer-lowest --prefer-stable |
| 104 | + |
| 105 | + - name: Run phpcs |
| 106 | + run: bin/phpcs --version && bin/phpcs --report=source --standard=phpcs.xml |
| 107 | + |
| 108 | + - name: Run phpstan |
| 109 | + run: bin/phpstan -V && bin/phpstan --error-format=github |
| 110 | + |
| 111 | + - name: Run Infection |
| 112 | + run: bin/infection |
0 commit comments