From 3080030b56a1a9eb5f2cf31347a15364a69ef36f Mon Sep 17 00:00:00 2001 From: Watheq Alshowaiter Date: Fri, 23 Aug 2024 22:10:41 +0300 Subject: [PATCH] debug: separate all sql in github actions --- .github/workflows/tests-for-databases.yml | 53 +-------------- .../workflows/tests-for-laravel-versions.yml | 4 +- .github/workflows/tests-for-mariadb.yml | 3 +- .github/workflows/tests-for-mysql.yml | 3 +- .github/workflows/tests-for-postgres.yml | 64 +++++++++++++++++++ 5 files changed, 74 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/tests-for-postgres.yml diff --git a/.github/workflows/tests-for-databases.yml b/.github/workflows/tests-for-databases.yml index 707a158..6cfb831 100644 --- a/.github/workflows/tests-for-databases.yml +++ b/.github/workflows/tests-for-databases.yml @@ -1,11 +1,12 @@ -name: tests-for-databases +name: tests-for-sql-server on: push: paths: - "**.php" - ".github/workflows/tests-for-laravel-versions.yml" - - ".github/workflows/tests-for-databases.yml" + - ".github/workflows/tests-for-sql-server.yml" + - ".github/workflows/tests-for-postgres.yml" - ".github/workflows/test-for-mariadb.yml" - ".github/workflows/tests-for-mysql.yml" - "phpunit.xml.dist" @@ -14,54 +15,6 @@ on: workflow_dispatch: jobs: - pgsql: - runs-on: ubuntu-24.04 - - services: - postgresql: - image: postgres:14 - env: - POSTGRES_DB: laravel - POSTGRES_USER: forge - POSTGRES_PASSWORD: password - ports: - - 5432:5432 - options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 - - strategy: - fail-fast: true - - name: PostgreSQL 14 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, :php-psr - tools: composer:v2 - coverage: none - - - name: Set Framework version - run: composer config version "11.x-dev" - - - name: Install dependencies - uses: nick-fields/retry@v3 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit - env: - DB_CONNECTION: pgsql - DB_USERNAME: forge - DB_PASSWORD: password - mssql: runs-on: ubuntu-20.04 diff --git a/.github/workflows/tests-for-laravel-versions.yml b/.github/workflows/tests-for-laravel-versions.yml index c202548..d6738b5 100644 --- a/.github/workflows/tests-for-laravel-versions.yml +++ b/.github/workflows/tests-for-laravel-versions.yml @@ -5,8 +5,10 @@ on: paths: - "**.php" - ".github/workflows/tests-for-laravel-versions.yml" - - ".github/workflows/tests-for-databases.yml" + - ".github/workflows/tests-for-sql-server.yml" + - ".github/workflows/tests-for-postgres.yml" - ".github/workflows/test-for-mariadb.yml" + - ".github/workflows/tests-for-mysql.yml" - "phpunit.xml.dist" - "composer.json" - "composer.lock" diff --git a/.github/workflows/tests-for-mariadb.yml b/.github/workflows/tests-for-mariadb.yml index 74d79fc..f34cf86 100644 --- a/.github/workflows/tests-for-mariadb.yml +++ b/.github/workflows/tests-for-mariadb.yml @@ -5,7 +5,8 @@ on: paths: - "**.php" - ".github/workflows/tests-for-laravel-versions.yml" - - ".github/workflows/tests-for-databases.yml" + - ".github/workflows/tests-for-sql-server.yml" + - ".github/workflows/tests-for-postgres.yml" - ".github/workflows/test-for-mariadb.yml" - ".github/workflows/tests-for-mysql.yml" - "phpunit.xml.dist" diff --git a/.github/workflows/tests-for-mysql.yml b/.github/workflows/tests-for-mysql.yml index a26da54..2f5fcaf 100644 --- a/.github/workflows/tests-for-mysql.yml +++ b/.github/workflows/tests-for-mysql.yml @@ -5,7 +5,8 @@ on: paths: - "**.php" - ".github/workflows/tests-for-laravel-versions.yml" - - ".github/workflows/tests-for-databases.yml" + - ".github/workflows/tests-for-sql-server.yml" + - ".github/workflows/tests-for-postgres.yml" - ".github/workflows/test-for-mariadb.yml" - ".github/workflows/tests-for-mysql.yml" - "phpunit.xml.dist" diff --git a/.github/workflows/tests-for-postgres.yml b/.github/workflows/tests-for-postgres.yml new file mode 100644 index 0000000..a2ce90d --- /dev/null +++ b/.github/workflows/tests-for-postgres.yml @@ -0,0 +1,64 @@ +name: tests-for-postgres + +on: + push: + paths: + - "**.php" + - ".github/workflows/tests-for-laravel-versions.yml" + - ".github/workflows/tests-for-sql-server.yml" + - ".github/workflows/tests-for-postgres.yml" + - ".github/workflows/test-for-mariadb.yml" + - ".github/workflows/tests-for-mysql.yml" + - "phpunit.xml.dist" + - "composer.json" + - "composer.lock" + workflow_dispatch: + +jobs: + pgsql: + runs-on: ubuntu-24.04 + + services: + postgresql: + image: postgres:14 + env: + POSTGRES_DB: laravel + POSTGRES_USER: forge + POSTGRES_PASSWORD: password + ports: + - 5432:5432 + options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: true + + name: PostgreSQL 14 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, :php-psr + tools: composer:v2 + coverage: none + + - name: Set Framework version + run: composer config version "11.x-dev" + + - name: Install dependencies + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit + env: + DB_CONNECTION: pgsql + DB_USERNAME: forge + DB_PASSWORD: password