Skip to content

Commit f550106

Browse files
authored
Refactor workflows (#997)
1 parent 125b202 commit f550106

11 files changed

Lines changed: 49 additions & 212 deletions

.github/workflows/active-record.yml

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ jobs:
7777
sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
7878
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
7979
80-
- name: Checkout.
81-
uses: actions/checkout@v4
82-
8380
- name: Create MS SQL Database.
8481
run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
8582

83+
- name: Checkout.
84+
uses: actions/checkout@v4
85+
8686
- name: Install PHP with extensions.
8787
uses: shivammathur/setup-php@v2
8888
with:
@@ -94,71 +94,14 @@ jobs:
9494
- name: Update composer.
9595
run: composer self-update
9696

97-
- name: Set environment variables pull request linux.
98-
uses: yiisoft/actions/db/environment-linux@master
99-
100-
- name: Install db-mssql.
101-
uses: yiisoft/actions/db/subpackage-install@master
102-
with:
103-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
104-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
105-
CURRENT_PACKAGE: db-mssql
106-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
107-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
108-
109-
- name: Install db-mysql.
110-
uses: yiisoft/actions/db/subpackage-install@master
111-
with:
112-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
113-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
114-
CURRENT_PACKAGE: db-mysql
115-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
116-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
117-
118-
- name: Install db-pgsql.
119-
uses: yiisoft/actions/db/subpackage-install@master
120-
with:
121-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
122-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
123-
CURRENT_PACKAGE: db-pgsql
124-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
125-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
126-
127-
- name: Install db-oracle.
128-
uses: yiisoft/actions/db/subpackage-install@master
129-
with:
130-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
131-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
132-
CURRENT_PACKAGE: db-oracle
133-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
134-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
135-
136-
- name: Install db-sqlite.
137-
uses: yiisoft/actions/db/subpackage-install@master
138-
with:
139-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
140-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
141-
CURRENT_PACKAGE: db-sqlite
142-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
143-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
144-
145-
- name: Install yiisoft/cache
146-
run: composer require yiisoft/cache
147-
148-
- name: Install yiisoft/factory
149-
run: composer require yiisoft/factory
150-
151-
- name: Install yiisoft/middleware-dispatcher
152-
run: composer require yiisoft/middleware-dispatcher
97+
- name: Install yiisoft/cache, yiisoft/factory and yiisoft/middleware-dispatcher
98+
run: composer require yiisoft/cache yiisoft/factory yiisoft/middleware-dispatcher
15399

154-
- name: Install active-record.
155-
uses: yiisoft/actions/db/subpackage-install@master
100+
- name: Install db-sqlite, db-mysql, db-pgsql, db-mssql, db-oracle and active-record.
101+
uses: yiisoft/actions/install-packages@master
156102
with:
157-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
158-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
159-
CURRENT_PACKAGE: active-record
160-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
161-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
103+
packages: >-
104+
['db-sqlite', 'db-mysql', 'db-pgsql', 'db-mssql', 'db-oracle', 'active-record']
162105
163106
- name: Run tests with phpunit with code coverage.
164107
run: vendor/bin/phpunit --testsuite ActiveRecord --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/composer-require-checker.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,5 @@ jobs:
2626
composer-require-checker:
2727
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
2828
with:
29-
os: >-
30-
['ubuntu-latest']
3129
php: >-
3230
['8.1', '8.2', '8.3', '8.4']

.github/workflows/db-mariadb.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
env:
3030
COMPOSER_ROOT_VERSION: dev-master
31-
CURRENT_PACKAGE: db-mysql
3231
EXTENSIONS: pdo, pdo_mysql
3332

3433
runs-on: ubuntu-latest
@@ -81,17 +80,11 @@ jobs:
8180
- name: Update composer.
8281
run: composer self-update
8382

84-
- name: Set environment variables pull request linux.
85-
uses: yiisoft/actions/db/environment-linux@master
86-
87-
- name: Install db.
88-
uses: yiisoft/actions/db/subpackage-install@master
83+
- name: Install db-mysql.
84+
uses: yiisoft/actions/install-packages@master
8985
with:
90-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
91-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
92-
CURRENT_PACKAGE: ${{ env.CURRENT_PACKAGE }}
93-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
94-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
86+
packages: >-
87+
['db-mysql']
9588
9689
- name: Run Mysql tests with phpunit and code coverage.
9790
run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/db-migration.yml

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ jobs:
7777
sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
7878
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
7979
80-
- name: Checkout.
81-
uses: actions/checkout@v4
82-
8380
- name: Create MS SQL Database.
8481
run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
8582

83+
- name: Checkout.
84+
uses: actions/checkout@v4
85+
8686
- name: Install PHP with extensions.
8787
uses: shivammathur/setup-php@v2
8888
with:
@@ -94,68 +94,14 @@ jobs:
9494
- name: Update composer.
9595
run: composer self-update
9696

97-
- name: Set environment variables pull request linux.
98-
uses: yiisoft/actions/db/environment-linux@master
99-
100-
- name: Install db-mssql.
101-
uses: yiisoft/actions/db/subpackage-install@master
102-
with:
103-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
104-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
105-
CURRENT_PACKAGE: db-mssql
106-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
107-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
108-
109-
- name: Install db-mysql.
110-
uses: yiisoft/actions/db/subpackage-install@master
111-
with:
112-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
113-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
114-
CURRENT_PACKAGE: db-mysql
115-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
116-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
117-
118-
- name: Install db-pgsql.
119-
uses: yiisoft/actions/db/subpackage-install@master
120-
with:
121-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
122-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
123-
CURRENT_PACKAGE: db-pgsql
124-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
125-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
126-
127-
- name: Install db-oracle.
128-
uses: yiisoft/actions/db/subpackage-install@master
129-
with:
130-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
131-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
132-
CURRENT_PACKAGE: db-oracle
133-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
134-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
135-
136-
- name: Install db-sqlite.
137-
uses: yiisoft/actions/db/subpackage-install@master
138-
with:
139-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
140-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
141-
CURRENT_PACKAGE: db-sqlite
142-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
143-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
144-
145-
- name: Install yiisoft/test-support
146-
run: composer require yiisoft/test-support
147-
148-
- name: Install yiisoft/yii-console
149-
run: composer require yiisoft/yii-console
97+
- name: Install yiisoft/test-support and yiisoft/yii-console
98+
run: composer require yiisoft/test-support yiisoft/yii-console
15099

151-
- name: Install db-migration.
152-
uses: yiisoft/actions/db/subpackage-install@master
100+
- name: Install db-sqlite, db-mysql, db-pgsql, db-mssql, db-oracle and db-migration.
101+
uses: yiisoft/actions/install-packages@master
153102
with:
154-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
155-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
156-
CURRENT_PACKAGE: db-migration
157-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
158-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
103+
packages: >-
104+
['db-sqlite', 'db-mysql', 'db-pgsql', 'db-mssql', 'db-oracle', 'db-migration']
159105
160106
- name: Run tests with phpunit with code coverage.
161107
run: vendor/bin/phpunit --testsuite=DbMigration --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/db-mysql.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
env:
3030
COMPOSER_ROOT_VERSION: dev-master
31-
CURRENT_PACKAGE: db-mysql
3231
EXTENSIONS: pdo, pdo_mysql
3332

3433
runs-on: ubuntu-latest
@@ -76,17 +75,11 @@ jobs:
7675
- name: Update composer.
7776
run: composer self-update
7877

79-
- name: Set environment variables pull request linux.
80-
uses: yiisoft/actions/db/environment-linux@master
81-
82-
- name: Install db.
83-
uses: yiisoft/actions/db/subpackage-install@master
78+
- name: Install db-mysql.
79+
uses: yiisoft/actions/install-packages@master
8480
with:
85-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
86-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
87-
CURRENT_PACKAGE: ${{ env.CURRENT_PACKAGE }}
88-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
89-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
81+
packages: >-
82+
['db-mysql']
9083
9184
- name: Run Mysql tests with phpunit and code coverage.
9285
run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/db-oracle.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
name: PHP ${{ matrix.php }}-${{ matrix.oracle }}
2828

2929
env:
30-
CURRENT_PACKAGE: db-oracle
3130
COMPOSER_ROOT_VERSION: dev-master
3231
EXTENSIONS: pdo, pdo_oci
3332

@@ -83,17 +82,11 @@ jobs:
8382
- name: Update composer.
8483
run: composer self-update
8584

86-
- name: Set environment variables pull request linux.
87-
uses: yiisoft/actions/db/environment-linux@master
88-
89-
- name: Install db.
90-
uses: yiisoft/actions/db/subpackage-install@master
85+
- name: Install db-oracle.
86+
uses: yiisoft/actions/install-packages@master
9187
with:
92-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
93-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
94-
CURRENT_PACKAGE: ${{ env.CURRENT_PACKAGE }}
95-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
96-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
88+
packages: >-
89+
['db-oracle']
9790
9891
- name: Run oracle tests with phpunit and code coverage.
9992
run: vendor/bin/phpunit --testsuite Oracle --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/db-pgsql.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
env:
3030
COMPOSER_ROOT_VERSION: dev-master
31-
CURRENT_PACKAGE: db-pgsql
3231
EXTENSIONS: pdo, pdo_pgsql
3332

3433
runs-on: ubuntu-latest
@@ -83,17 +82,11 @@ jobs:
8382
- name: Update composer.
8483
run: composer self-update
8584

86-
- name: Set environment variables pull request linux.
87-
uses: yiisoft/actions/db/environment-linux@master
88-
89-
- name: Install db.
90-
uses: yiisoft/actions/db/subpackage-install@master
85+
- name: Install db-pgsql.
86+
uses: yiisoft/actions/install-packages@master
9187
with:
92-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
93-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
94-
CURRENT_PACKAGE: ${{ env.CURRENT_PACKAGE }}
95-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
96-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
88+
packages: >-
89+
['db-pgsql']
9790
9891
- name: Run pgsql tests with phpunit and code coverage.
9992
run: vendor/bin/phpunit --testsuite Pgsql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/db-sqlite.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
env:
3030
COMPOSER_ROOT_VERSION: dev-master
31-
CURRENT_PACKAGE: db-sqlite
3231
EXTENSIONS: pdo, pdo_sqlite
3332

3433
runs-on: ${{ matrix.os }}
@@ -60,22 +59,11 @@ jobs:
6059
- name: Update composer.
6160
run: composer self-update
6261

63-
- name: Set environment variables pull request linux.
64-
if: matrix.os == 'ubuntu-latest'
65-
uses: yiisoft/actions/db/environment-linux@master
66-
67-
- name: Set environment variables pull request windows.
68-
if: matrix.os == 'windows-latest'
69-
uses: yiisoft/actions/db/environment-windows@master
70-
71-
- name: Install db.
72-
uses: yiisoft/actions/db/subpackage-install@master
62+
- name: Install db-sqlite.
63+
uses: yiisoft/actions/install-packages@master
7364
with:
74-
BRANCH_NAME: ${{ env.BRANCH_NAME }}
75-
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
76-
CURRENT_PACKAGE: ${{ env.CURRENT_PACKAGE }}
77-
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
78-
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
65+
packages: >-
66+
['db-sqlite']
7967
8068
- name: Run sqlite tests with phpunit and code coverage.
8169
run: vendor/bin/phpunit --testsuite Sqlite --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations

.github/workflows/rector.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ on:
33
paths:
44
- 'src/**'
55
- 'config/**'
6+
- 'tests/**'
67
- '.github/workflows/rector.yml'
78
- 'composer.json'
89
- 'rector.php'
910

10-
name: rector
11+
name: Rector
1112

1213
concurrency:
1314
group: ${{ github.workflow }}-${{ github.ref }}
@@ -20,7 +21,5 @@ jobs:
2021
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
2122
with:
2223
repository: ${{ github.event.pull_request.head.repo.full_name }}
23-
os: >-
24-
['ubuntu-latest']
2524
php: >-
2625
['8.4']

.github/workflows/static.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- 'psalm*.xml'
1717
- 'composer.json'
1818

19-
name: static analysis
19+
name: Static analysis
2020

2121
concurrency:
2222
group: ${{ github.workflow }}-${{ github.ref }}
@@ -26,7 +26,5 @@ jobs:
2626
psalm:
2727
uses: yiisoft/actions/.github/workflows/psalm.yml@master
2828
with:
29-
os: >-
30-
['ubuntu-latest']
3129
php: >-
3230
['8.2', '8.3', '8.4']

0 commit comments

Comments
 (0)