Skip to content

Commit f99001c

Browse files
debug: separate some github actions
1 parent 3b31515 commit f99001c

File tree

4 files changed

+208
-196
lines changed

4 files changed

+208
-196
lines changed

.github/workflows/tests-for-databases.yml

-91
Original file line numberDiff line numberDiff line change
@@ -13,97 +13,6 @@ on:
1313
workflow_dispatch:
1414

1515
jobs:
16-
mysql_57:
17-
runs-on: ubuntu-24.04
18-
19-
services:
20-
mysql:
21-
image: mysql:5.7
22-
env:
23-
MYSQL_ALLOW_EMPTY_PASSWORD: yes
24-
MYSQL_DATABASE: laravel
25-
ports:
26-
- 3306:3306
27-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
28-
29-
strategy:
30-
fail-fast: true
31-
32-
name: MySQL 5.7
33-
34-
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v4
37-
38-
- name: Setup PHP
39-
uses: shivammathur/setup-php@v2
40-
with:
41-
php-version: 8.2
42-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
43-
tools: composer:v2
44-
coverage: none
45-
46-
- name: Set Framework version
47-
run: composer config version "11.x-dev"
48-
49-
- name: Install dependencies
50-
uses: nick-fields/retry@v3
51-
with:
52-
timeout_minutes: 5
53-
max_attempts: 5
54-
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
55-
56-
- name: Execute tests
57-
run: vendor/bin/phpunit
58-
env:
59-
DB_CONNECTION: mysql
60-
DB_COLLATION: utf8mb4_unicode_ci
61-
62-
mysql_8:
63-
runs-on: ubuntu-24.04
64-
65-
services:
66-
mysql:
67-
image: mysql:8
68-
env:
69-
MYSQL_ALLOW_EMPTY_PASSWORD: yes
70-
MYSQL_DATABASE: laravel
71-
ports:
72-
- 3306:3306
73-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
74-
75-
strategy:
76-
fail-fast: true
77-
78-
name: MySQL 8
79-
80-
steps:
81-
- name: Checkout code
82-
uses: actions/checkout@v4
83-
84-
- name: Setup PHP
85-
uses: shivammathur/setup-php@v2
86-
with:
87-
php-version: 8.2
88-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
89-
tools: composer:v2
90-
coverage: none
91-
92-
- name: Set Framework version
93-
run: composer config version "11.x-dev"
94-
95-
- name: Install dependencies
96-
uses: nick-fields/retry@v3
97-
with:
98-
timeout_minutes: 5
99-
max_attempts: 5
100-
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
101-
102-
- name: Execute tests
103-
run: vendor/bin/phpunit
104-
env:
105-
DB_CONNECTION: mysql
106-
10716
pgsql:
10817
runs-on: ubuntu-24.04
10918

.github/workflows/tests-for-mysql.yml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: tests-for-databases
2+
3+
on:
4+
push:
5+
paths:
6+
- "**.php"
7+
- ".github/workflows/tests-for-laravel-versions.yml"
8+
- ".github/workflows/tests-for-databases.yml"
9+
- ".github/workflows/test-for-mariadb.yml"
10+
- "phpunit.xml.dist"
11+
- "composer.json"
12+
- "composer.lock"
13+
workflow_dispatch:
14+
15+
jobs:
16+
mysql_57:
17+
runs-on: ubuntu-24.04
18+
19+
services:
20+
mysql:
21+
image: mysql:5.7
22+
env:
23+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
24+
MYSQL_DATABASE: laravel
25+
ports:
26+
- 3306:3306
27+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
28+
29+
strategy:
30+
fail-fast: true
31+
32+
name: MySQL 5.7
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: 8.2
42+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
43+
tools: composer:v2
44+
coverage: none
45+
46+
- name: Set Framework version
47+
run: composer config version "11.x-dev"
48+
49+
- name: Install dependencies
50+
uses: nick-fields/retry@v3
51+
with:
52+
timeout_minutes: 5
53+
max_attempts: 5
54+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
55+
56+
- name: Execute tests
57+
run: vendor/bin/phpunit
58+
env:
59+
DB_CONNECTION: mysql
60+
DB_COLLATION: utf8mb4_unicode_ci
61+
62+
mysql_8:
63+
runs-on: ubuntu-24.04
64+
65+
services:
66+
mysql:
67+
image: mysql:8
68+
env:
69+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
70+
MYSQL_DATABASE: laravel
71+
ports:
72+
- 3306:3306
73+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
74+
75+
strategy:
76+
fail-fast: true
77+
78+
name: MySQL 8
79+
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@v4
83+
84+
- name: Setup PHP
85+
uses: shivammathur/setup-php@v2
86+
with:
87+
php-version: 8.2
88+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
89+
tools: composer:v2
90+
coverage: none
91+
92+
- name: Set Framework version
93+
run: composer config version "11.x-dev"
94+
95+
- name: Install dependencies
96+
uses: nick-fields/retry@v3
97+
with:
98+
timeout_minutes: 5
99+
max_attempts: 5
100+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
101+
102+
- name: Execute tests
103+
run: vendor/bin/phpunit
104+
env:
105+
DB_CONNECTION: mysql

database/migrations/2024_07_13_090447_create_fathers_table.php

+7-10
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,26 @@ class CreateFathersTable extends Migration
1212
public function up(): void
1313
{
1414
Schema::create('fathers', function (Blueprint $table) {
15-
$table->bigIncrements('id'); // primary key -> ignored
16-
$table->boolean('active')->default(false); // default => ignored
17-
$table->string('first_name'); // required
18-
$table->string('last_name'); // required
19-
$table->string('email'); // required
15+
$table->bigIncrements('id');
16+
$table->boolean('active')->default(false);
17+
$table->string('first_name');
18+
$table->string('last_name');
19+
$table->string('email');
2020

2121
if (DB::getDriverName() == 'mysql' || DB::getDriverName() == 'mariadb') {
2222
$table->string('full_name')->virtualAs("CONCAT(first_name, ' ', last_name)");
23-
//$table->string('status')->storedAs('IF(active = 1, TRUE, FALSE)');
2423
}
2524

2625
if ((float) App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT && DB::getDriverName() == 'sqlite') {
27-
$table->string('full_name')->virtualAs("first_name || ' ' || last_name"); // (MySQL/PostgreSQL/SQLite)
28-
//$table->string('status')->storedAs("CASE WHEN active = 1 THEN 'Active' ELSE 'Inactive' END"); // (MySQL/PostgreSQL/SQLite)
26+
$table->string('full_name')->virtualAs("first_name || ' ' || last_name");
2927
}
3028

3129
if ((float) App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT && DB::getDriverName() == 'pgsql') {
3230
$table->string('full_name')->storedAs("first_name || ' ' || last_name");
33-
//$table->string('status')->storedAs("CASE WHEN active THEN 'Active' ELSE 'Inactive' END");
3431
}
3532

3633

37-
$table->timestamps(); // created_at, updated_at => ignored because they are nullable
34+
$table->timestamps();
3835
});
3936

4037
if ((float)App::version() >= Constants::VERSION_AFTER_STORED_AS_VIRTUAL_AS_SUPPORT && DB::getDriverName() == 'sqlsrv') {

0 commit comments

Comments
 (0)