|
| 1 | +name: Test Suite |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + paths-ignore: |
| 8 | + - README.md |
| 9 | + pull_request: |
| 10 | + |
| 11 | +jobs: |
| 12 | + phpunit: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + services: |
| 15 | + firebird: |
| 16 | + image: >- |
| 17 | + ${{ (matrix.fb == '3.0' && 'firebirdsql/firebird:3') || |
| 18 | + (matrix.fb == '4.0' && 'firebirdsql/firebird:4') }} |
| 19 | + ports: |
| 20 | + - 3050:3050 |
| 21 | + env: |
| 22 | + FIREBIRD_ROOT_PASSWORD: masterkey |
| 23 | + FIREBIRD_DATABASE: TEST.FDB |
| 24 | + FIREBIRD_DATABASE_DEFAULT_CHARSET: UTF8 |
| 25 | + FIREBIRD_DATABASE_PAGE_SIZE: 16384 # Ensure this is treated as a number by the image |
| 26 | + |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + php: ['5.6', '7.0', '7.4', '8.0', '8.1', '8.2', 'nightly'] |
| 30 | + fb: ['3.0', '4.0'] |
| 31 | + fail-fast: false |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout code |
| 35 | + uses: actions/checkout@v3 |
| 36 | + |
| 37 | + - name: Setup PHP ${{ matrix.php }} |
| 38 | + uses: shivammathur/setup-php@v2 |
| 39 | + with: |
| 40 | + php-version: ${{ matrix.php }} |
| 41 | + coverage: xdebug |
| 42 | + extensions: pdo, pdo_firebird |
| 43 | + |
| 44 | + - name: Install Firebird client and dev files |
| 45 | + run: | |
| 46 | + sudo apt-get install -y firebird-utils firebird-dev |
| 47 | +
|
| 48 | + - name: Cache Composer dependencies |
| 49 | + uses: actions/cache@v3 |
| 50 | + with: |
| 51 | + path: ~/.composer/cache |
| 52 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 53 | + restore-keys: ${{ runner.os }}-composer- |
| 54 | + |
| 55 | + - name: Install Composer dependencies |
| 56 | + run: | |
| 57 | + composer self-update |
| 58 | + composer global require "hiqdev/composer-asset-plugin:^1.2" --prefer-dist --no-interaction |
| 59 | + composer install --prefer-dist --no-interaction |
| 60 | + composer require "phpunit/php-invoker" --dev --prefer-dist --no-interaction |
| 61 | +
|
| 62 | + - name: Run PHPUnit |
| 63 | + env: |
| 64 | + PHPUNIT_FLAGS: ${{ matrix.php == '7.0' && matrix.fb == '3.0' && '--coverage-clover=coverage.clover' }} |
| 65 | + run: vendor/bin/phpunit --verbose $PHPUNIT_FLAGS --enforce-time-limit |
| 66 | + |
| 67 | + - name: Upload Code Coverage |
| 68 | + if: matrix.php == '7.0' && matrix.fb == '3.0' |
| 69 | + uses: codecov/codecov-action@v3 |
0 commit comments