Skip to content

Commit

Permalink
debug: separate all sql in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Aug 23, 2024
1 parent 7d40af6 commit 3080030
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 53 deletions.
53 changes: 3 additions & 50 deletions .github/workflows/tests-for-databases.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests-for-laravel-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests-for-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests-for-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/tests-for-postgres.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3080030

Please sign in to comment.