diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5e06b70..57b110f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,14 +9,9 @@ on: workflow_dispatch: env: - MYSQL_IMAGE: mysql:8.0 - MYSQL_PORT: 3306 - MYSQL_DB_OPTIONS: "--health-cmd=\"mysqladmin ping\" --health-interval=10s --health-timeout=5s --health-retries=3" - MYSQL_PHPUNIT_CONFIG: "phpunit-ci-mysql.xml.dist" POSTGRES_IMAGE: postgres:17 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: @@ -25,20 +20,16 @@ jobs: name: Prepare environment runs-on: ubuntu-latest outputs: - MYSQL_IMAGE: ${{ env.MYSQL_IMAGE }} - MYSQL_PORT: ${{ env.MYSQL_PORT }} - MYSQL_DB_OPTIONS: ${{ env.MYSQL_DB_OPTIONS }} - MYSQL_PHPUNIT_CONFIG: ${{ env.MYSQL_PHPUNIT_CONFIG }} - POSTGRES_IMAGE: ${{ env.POSTGRES_IMAGE }} - POSTGRES_PORT: ${{ env.POSTGRES_PORT }} - POSTGRES_DB_OPTIONS: ${{ env.POSTGRES_DB_OPTIONS }} - POSTGRES_PHPUNIT_CONFIG: ${{ env.POSTGRES_PHPUNIT_CONFIG }} + POSTGRES_IMAGE: postgres:17 + POSTGRES_PORT: "5432" + POSTGRES_DB_OPTIONS: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3" + MATRIX_EXCLUDE: "[{\"php\"=>\"8.3\", \"laravel\"=>\"9.*\"},{\"php\"=>\"8.1\", \"laravel\"=>\"11.*\"}]" steps: # Placeholder because a job needs a step. - run: echo "null" mysql-tests: - name: MySQL tests + name: MySQL needs: prepare uses: cybex-gmbh/github-workflows/.github/workflows/tests.yml@feature/pass-db-image strategy: @@ -47,11 +38,7 @@ jobs: 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.* + exclude: ${{ needs.prepare.outputs.MATRIX_EXCLUDE }} with: DATABASE_NAME: protector_test PHP_VERSION: ${{ matrix.php }} @@ -60,7 +47,7 @@ jobs: TEST_COMMANDS: vendor/bin/phpunit -c ${{ needs.prepare.outputs.MYSQL_PHPUNIT_CONFIG }} postgres-tests: - name: PostgreSQL tests + name: PostgreSQL needs: prepare uses: cybex-gmbh/github-workflows/.github/workflows/tests.yml@feature/pass-db-image strategy: @@ -69,11 +56,7 @@ jobs: 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.* + exclude: ${{ needs.prepare.outputs.MATRIX_EXCLUDE }} with: DATABASE_IMAGE: ${{ needs.prepare.outputs.POSTGRES_IMAGE }} DATABASE_NAME: protector_test @@ -84,4 +67,4 @@ jobs: 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 }} + TEST_COMMANDS: vendor/bin/phpunit -c phpunit-ci.xml.dist diff --git a/phpunit-ci-postgres.xml.dist b/phpunit-ci-postgres.xml.dist deleted file mode 100644 index 47c7fd7..0000000 --- a/phpunit-ci-postgres.xml.dist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - tests/feature - - - - - - - - - - - - - - - - - - ./src - - - diff --git a/phpunit-ci-mysql.xml.dist b/phpunit-ci.xml.dist similarity index 100% rename from phpunit-ci-mysql.xml.dist rename to phpunit-ci.xml.dist