mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 04:30:09 +00:00
Added multi-database architecture CI pipeline (#2295)
Co-authored-by: Alex Justesen <1144087+alexjustesen@users.noreply.github.com>
This commit is contained in:
+216
-4
@@ -21,7 +21,217 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: lint --using=pint -v
|
args: lint --using=pint -v
|
||||||
|
|
||||||
test-app:
|
test-mariadb-11:
|
||||||
|
needs: lint-app
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:11
|
||||||
|
env:
|
||||||
|
MARIADB_ROOT_PASSWORD: password
|
||||||
|
MARIADB_DATABASE: testing
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.3'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
npm ci && npm run build
|
||||||
|
|
||||||
|
- name: Copy Environment File
|
||||||
|
run: cp .env.ci .env
|
||||||
|
|
||||||
|
- name: Generate App Key
|
||||||
|
run: php artisan key:generate --quiet
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: php artisan test
|
||||||
|
env:
|
||||||
|
DB_CONNECTION: mysql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_PORT: 3306
|
||||||
|
DB_DATABASE: testing
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: password
|
||||||
|
|
||||||
|
test-mysql-8:
|
||||||
|
needs: lint-app
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:8
|
||||||
|
env:
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: testing
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.3'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
npm ci && npm run build
|
||||||
|
|
||||||
|
- name: Copy Environment File
|
||||||
|
run: cp .env.ci .env
|
||||||
|
|
||||||
|
- name: Generate App Key
|
||||||
|
run: php artisan key:generate --quiet
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: php artisan test
|
||||||
|
env:
|
||||||
|
DB_CONNECTION: mysql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_PORT: 3306
|
||||||
|
DB_DATABASE: testing
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: password
|
||||||
|
|
||||||
|
test-postgres-15:
|
||||||
|
needs: lint-app
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:15
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: testing
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: --health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.3'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
npm ci && npm run build
|
||||||
|
|
||||||
|
- name: Copy Environment File
|
||||||
|
run: cp .env.ci .env
|
||||||
|
|
||||||
|
- name: Generate App Key
|
||||||
|
run: php artisan key:generate --quiet
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: php artisan test
|
||||||
|
env:
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_DATABASE: testing
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_PASSWORD: password
|
||||||
|
|
||||||
|
test-postgres-16:
|
||||||
|
needs: lint-app
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: testing
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: --health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.3'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
npm ci && npm run build
|
||||||
|
|
||||||
|
- name: Copy Environment File
|
||||||
|
run: cp .env.ci .env
|
||||||
|
|
||||||
|
- name: Generate App Key
|
||||||
|
run: php artisan key:generate --quiet
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: php artisan test
|
||||||
|
env:
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_DATABASE: testing
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_PASSWORD: password
|
||||||
|
|
||||||
|
test-postgres-17:
|
||||||
|
needs: lint-app
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:17
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: testing
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: --health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.3'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
npm ci && npm run build
|
||||||
|
|
||||||
|
- name: Copy Environment File
|
||||||
|
run: cp .env.ci .env
|
||||||
|
|
||||||
|
- name: Generate App Key
|
||||||
|
run: php artisan key:generate --quiet
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: php artisan test
|
||||||
|
env:
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_DATABASE: testing
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_PASSWORD: password
|
||||||
|
|
||||||
|
test-sqlite:
|
||||||
needs: lint-app
|
needs: lint-app
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
@@ -35,7 +245,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create SQLite Database
|
- name: Create SQLite Database
|
||||||
run: |
|
run: |
|
||||||
touch database/testing.sqlite
|
touch database/database.sqlite
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -43,10 +253,12 @@ jobs:
|
|||||||
npm ci && npm run build
|
npm ci && npm run build
|
||||||
|
|
||||||
- name: Copy Environment File
|
- name: Copy Environment File
|
||||||
run: cp .env.example .env
|
run: cp .env.ci .env
|
||||||
|
|
||||||
- name: Generate App Key
|
- name: Generate App Key
|
||||||
run: php artisan key:generate --quiet
|
run: php artisan key:generate --quiet
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: php artisan test --parallel
|
run: php artisan test
|
||||||
|
env:
|
||||||
|
DB_CONNECTION: sqlite
|
||||||
+7
-7
@@ -19,12 +19,12 @@
|
|||||||
</source>
|
</source>
|
||||||
<php>
|
<php>
|
||||||
<env name="APP_ENV" value="testing"/>
|
<env name="APP_ENV" value="testing"/>
|
||||||
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
<!-- <env name="APP_MAINTENANCE_DRIVER" value="file"/> -->
|
||||||
<env name="CACHE_STORE" value="database"/>
|
<!-- <env name="CACHE_STORE" value="database"/> -->
|
||||||
<env name="DB_CONNECTION" value="sqlite"/>
|
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
|
||||||
<env name="DB_DATABASE" value=":memory:"/>
|
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
|
||||||
<env name="MAIL_MAILER" value="array"/>
|
<!-- <env name="MAIL_MAILER" value="array"/> -->
|
||||||
<env name="QUEUE_CONNECTION" value="database"/>
|
<!-- <env name="QUEUE_CONNECTION" value="database"/> -->
|
||||||
<env name="SESSION_DRIVER" value="database"/>
|
<!-- <env name="SESSION_DRIVER" value="database"/> -->
|
||||||
</php>
|
</php>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
Reference in New Issue
Block a user