Tests #442
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| # Allow job to be triggered manually. | |
| workflow_dispatch: | |
| # Run job each night. | |
| schedule: | |
| - cron: '0 4 * * *' | |
| # Cancel in-progress jobs when pushing to the same branch. | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ 'ubuntu-latest' ] #, macos-latest, windows-latest ] | |
| php-version: [ | |
| '8.0', | |
| '8.1', | |
| '8.2', | |
| '8.3', | |
| '8.4', | |
| '8.5', | |
| ] | |
| cratedb-version: [ 'nightly' ] | |
| include: | |
| - os: 'ubuntu-latest' | |
| php-version: '8.5' | |
| cratedb-version: '6.0.3' | |
| # https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers | |
| services: | |
| cratedb: | |
| image: crate/crate:${{ matrix.cratedb-version }} | |
| ports: | |
| - 4200:4200 | |
| # https://github.com/marketplace/actions/setup-php-action | |
| name: PHP ${{ matrix.php-version }}, CrateDB ${{ matrix.cratedb-version }} | |
| steps: | |
| - name: Acquire sources | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| # Select PHPUnit version suitable for PHP 7.2. | |
| tools: composer, phpunit:^8.5 | |
| - uses: ramsey/composer-install@v4 | |
| # Remark: --prefer-source is needed for "Doctrine\Tests\DBAL\Platforms\AbstractPlatformTestCase" | |
| - name: Install doctrine/dbal from source | |
| run: | | |
| rm -rf vendor/doctrine/dbal | |
| composer update doctrine/dbal --prefer-source | |
| - name: Run code style checks | |
| run: composer run check-style | |
| - name: Run tests | |
| run: composer run test | |
| # https://github.com/codecov/codecov-action | |
| - name: Upload coverage results to Codecov | |
| uses: codecov/codecov-action@v6 | |
| if: always() && (matrix.php-version == '7.4' || startsWith(matrix.php-version, '8.')) | |
| with: | |
| files: ./build/logs/clover.xml | |
| fail_ci_if_error: false | |
| - name: Upload coverage results to Scrutinizer CI | |
| if: always() && (matrix.php-version == '7.4' || startsWith(matrix.php-version, '8.')) | |
| run: | | |
| composer global require scrutinizer/ocular | |
| ocular code-coverage:upload --format=php-clover build/logs/clover.xml |