Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mszulik committed Dec 18, 2024
1 parent cefd86a commit ee5643c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 52 deletions.
35 changes: 9 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
26 changes: 0 additions & 26 deletions phpunit-ci-postgres.xml.dist

This file was deleted.

File renamed without changes.

0 comments on commit ee5643c

Please sign in to comment.