diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 411aa40..5e06b70 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,7 @@ env: POSTGRES_PORT: 5432 POSTGRES_DB_OPTIONS: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3" POSTGRES_PHPUNIT_CONFIG: "phpunit-ci-postgres.xml.dist" + MATRIX_EXCLUDE: "[{\"php\"=>\"8.3\", \"laravel\"=>\"9.*\"},{\"php\"=>\"8.1\", \"laravel\"=>\"11.*\"}]" jobs: # Environment variables are not available in the matrix context, so we have to define them as outputs. @@ -37,14 +38,12 @@ jobs: - run: echo "null" mysql-tests: - name: Setup testing environment and execute tests + name: MySQL tests needs: prepare uses: cybex-gmbh/github-workflows/.github/workflows/tests.yml@feature/pass-db-image strategy: fail-fast: true matrix: - db-image: [ "${{ needs.prepare.outputs.MYSQL_IMAGE }}", "${{ needs.prepare.outputs.POSTGRES_IMAGE }}" ] - db-options: [ "${{ needs.prepare.outputs.MYSQL_DB_OPTIONS }}", "${{ needs.prepare.outputs.POSTGRES_DB_OPTIONS }}" ] php: [ 8.1, 8.2, 8.3 ] laravel: [ 9.*, 10.*, 11.* ] dependency-version: [ prefer-stable ] @@ -53,16 +52,36 @@ jobs: laravel: 9.* - php: 8.1 laravel: 11.* - - db-image: "${{ needs.prepare.outputs.MYSQL_IMAGE }}" - db-options: "${{ needs.prepare.outputs.POSTGRES_DB_OPTIONS }}" - - db-image: "${{ needs.prepare.outputs.POSTGRES_IMAGE }}" - db-options: "${{ needs.prepare.outputs.MYSQL_DB_OPTIONS }}" with: - DATABASE_IMAGE: ${{ matrix.db-image }} DATABASE_NAME: protector_test - DATABASE_PORT: ${{ matrix.db-image == needs.prepare.outputs.MYSQL_IMAGE && needs.prepare.outputs.MYSQL_PORT || needs.prepare.outputs.POSTGRES_PORT }} - DATABASE_OPTIONS: ${{ matrix.db-options }} PHP_VERSION: ${{ matrix.php }} LARAVEL_VERSION: ${{ matrix.laravel }} DEPENDENCY_VERSION: ${{ matrix.dependency-version }} - TEST_COMMANDS: vendor/bin/phpunit -c ${{ matrix.db-image == needs.prepare.outputs.MYSQL_IMAGE && needs.prepare.outputs.MYSQL_PHPUNIT_CONFIG || needs.prepare.outputs.POSTGRES_PHPUNIT_CONFIG }} + TEST_COMMANDS: vendor/bin/phpunit -c ${{ needs.prepare.outputs.MYSQL_PHPUNIT_CONFIG }} + + postgres-tests: + name: PostgreSQL tests + needs: prepare + uses: cybex-gmbh/github-workflows/.github/workflows/tests.yml@feature/pass-db-image + strategy: + fail-fast: true + matrix: + php: [ 8.1, 8.2, 8.3 ] + laravel: [ 9.*, 10.*, 11.* ] + dependency-version: [ prefer-stable ] + exclude: + - php: 8.3 + laravel: 9.* + - php: 8.1 + laravel: 11.* + with: + DATABASE_IMAGE: ${{ needs.prepare.outputs.POSTGRES_IMAGE }} + DATABASE_NAME: protector_test + DATABASE_PORT: ${{ needs.prepare.outputs.POSTGRES_PORT }} + DATABASE_USERNAME: postgres + DATABASE_CONNECTION: pgsql + DATABASE_OPTIONS: ${{ needs.prepare.outputs.POSTGRES_DB_OPTIONS }} + PHP_VERSION: ${{ matrix.php }} + LARAVEL_VERSION: ${{ matrix.laravel }} + DEPENDENCY_VERSION: ${{ matrix.dependency-version }} + TEST_COMMANDS: vendor/bin/phpunit -c ${{ needs.prepare.outputs.MYSQL_PHPUNIT_CONFIG }}