Skip to content

Commit a98ba75

Browse files
committed
5282: Task and compose-ified actions
1 parent 1883bf4 commit a98ba75

File tree

2 files changed

+55
-190
lines changed

2 files changed

+55
-190
lines changed

.github/workflows/pr.yaml

Lines changed: 55 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,62 @@
1-
on: pull_request
1+
on:
2+
pull_request:
3+
24
name: Review
5+
6+
env:
7+
COMPOSE_USER: root
8+
39
jobs:
410
test-composer-install:
511
runs-on: ubuntu-latest
6-
strategy:
7-
fail-fast: false
8-
matrix:
9-
php: ["8.4"]
10-
name: Validate composer (${{ matrix.php}})
12+
name: Composer install
1113
steps:
1214
- uses: actions/checkout@v4
1315

14-
- name: Setup PHP, with composer and extensions
15-
uses: shivammathur/setup-php@v2
16+
# https://taskfile.dev/installation/#github-actions
17+
- name: Install Task
18+
uses: arduino/setup-task@v2
1619
with:
17-
php-version: ${{ matrix.php}}
18-
coverage: none
19-
20-
- name: Get composer cache directory
21-
id: composer-cache
22-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
20+
version: 3.x
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2322

24-
- name: Cache dependencies
25-
uses: actions/cache@v4
26-
with:
27-
path: ${{ steps.composer-cache.outputs.dir }}
28-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
29-
restore-keys: ${{ runner.os }}-composer-
23+
- name: Start docker compose setup
24+
run: |
25+
docker network create frontend
26+
task compose -- up --detach
3027
3128
- name: Validate composer files
32-
run: composer validate composer.json --strict
29+
run: |
30+
task composer -- validate composer.json --strict
3331
3432
- name: Composer install with exported .env variables
3533
run: |
36-
set -a && source .env && set +a
37-
APP_ENV=prod composer install --no-dev -o
34+
docker compose --env-file .env exec --env APP_ENV=prod phpfpm composer install --no-dev --optimize-autoloader
3835
3936
test-suite:
4037
name: Test suite (${{ matrix.php }})
4138
runs-on: ubuntu-latest
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
php: ["8.4"]
4639
steps:
4740
- uses: actions/checkout@v4
4841

49-
- name: Setup PHP, with composer and extensions
50-
uses: shivammathur/setup-php@v2
42+
- name: Install Task
43+
uses: arduino/setup-task@v2
5144
with:
52-
php-version: ${{ matrix.php}}
53-
coverage: xdebug
45+
version: 3.x
46+
repo-token: ${{ secrets.GITHUB_TOKEN }}
5447

55-
- name: Get composer cache directory
56-
id: composer-cache
57-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
58-
59-
- name: Cache dependencies
60-
uses: actions/cache@v4
61-
with:
62-
path: ${{ steps.composer-cache.outputs.dir }}
63-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
64-
restore-keys: ${{ runner.os }}-composer-
48+
- name: Start docker compose setup
49+
run: |
50+
docker network create frontend
51+
task compose -- up --detach
6552
6653
- name: Install Dependencies
67-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
54+
run: |
55+
task composer -- install
6856
6957
- name: Test suite
70-
run: ./vendor/bin/phpunit --coverage-clover=coverage/unit.xml
58+
run: |
59+
task compose -- exec phpfpm vendor/bin/phpunit --coverage-clover=coverage/unit.xml
7160
7261
- name: Upload coverage to Codecov test
7362
uses: codecov/codecov-action@v4
@@ -88,81 +77,41 @@ jobs:
8877
steps:
8978
- uses: actions/checkout@v4
9079

91-
- name: Setup PHP, with composer and extensions
92-
uses: shivammathur/setup-php@v2
80+
- name: Install Task
81+
uses: arduino/setup-task@v2
9382
with:
94-
php-version: ${{ matrix.php}}
95-
coverage: none
96-
tools: cs2pr, phpcs
97-
98-
- name: Get composer cache directory
99-
id: composer-cache
100-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
83+
version: 3.x
84+
repo-token: ${{ secrets.GITHUB_TOKEN }}
10185

102-
- name: Cache dependencies
103-
uses: actions/cache@v4
104-
with:
105-
path: ${{ steps.composer-cache.outputs.dir }}
106-
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
107-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-
86+
- name: Start docker compose setup
87+
run: |
88+
docker network create frontend
89+
task compose -- up --detach
10890
109-
- name: Install dependencies
110-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
91+
- name: Install Dependencies
92+
run: |
93+
task composer -- install
11194
11295
- name: Run PHPStan
113-
run: ./vendor/bin/phpstan
96+
run: |
97+
task code-analysis:phpstan
11498
11599
validate-doctrine-schema:
116100
runs-on: ubuntu-latest
117-
env:
118-
DATABASE_URL: mysql://db:[email protected]:3306/db_test?serverVersion=mariadb-10.5.13
119-
strategy:
120-
fail-fast: false
121-
matrix:
122-
php: ["8.4"]
123-
name: Validate Doctrine Schema (PHP ${{ matrix.php}})
124-
services:
125-
mariadb:
126-
image: mariadb:10.5.13
127-
env:
128-
MYSQL_USER: db
129-
MYSQL_PASSWORD: db
130-
MYSQL_DATABASE: db_test
131-
MYSQL_ROOT_PASSWORD: password
132-
ports:
133-
- 3306:3306
134-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
101+
name: Validate Doctrine Schema
135102
steps:
136-
- name: Checkout
137-
uses: actions/checkout@v4
138-
139-
- name: Setup PHP, with composer and extensions
140-
uses: shivammathur/setup-php@v2
141-
with:
142-
php-version: ${{ matrix.php}}
143-
extensions: apcu, ctype, iconv, imagick, json, pdo_sqlsrv, redis, soap, sqlsrv, xmlreader, zip
144-
coverage: none
145-
146-
- name: Get composer cache directory
147-
id: composer-cache
148-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
103+
- uses: actions/checkout@v4
149104

150-
- name: Cache dependencies
151-
uses: actions/cache@v4
105+
- name: Install Task
106+
uses: arduino/setup-task@v2
152107
with:
153-
path: ${{ steps.composer-cache.outputs.dir }}
154-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
155-
restore-keys: ${{ runner.os }}-composer-
108+
version: 3.x
109+
repo-token: ${{ secrets.GITHUB_TOKEN }}
156110

157-
- name: Composer install with exported .env variables
111+
- name: Install site
158112
run: |
159-
set -a && source .env && set +a
160-
APP_ENV=prod composer install --no-dev -o
161-
- name: Run Doctrine Migrations
162-
run: APP_ENV=prod php bin/console doctrine:migrations:migrate --no-interaction
163-
164-
- name: Setup failed messenger transport table.
165-
run: APP_ENV=prod php bin/console messenger:setup-transports failed
113+
task site:update
166114
167115
- name: Validate Doctrine schema
168-
run: APP_ENV=prod php bin/console doctrine:schema:validate
116+
run: |
117+
task console -- doctrine:schema:validate

phpstan-baseline.neon

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -30,90 +30,6 @@ parameters:
3030
count: 1
3131
path: src/Command/Migrate/MigrateTagsCommand.php
3232

33-
-
34-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
35-
identifier: arguments.count
36-
count: 2
37-
path: src/DataFixtures/DailyOccurrenceFixture.php
38-
39-
-
40-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
41-
identifier: argument.templateType
42-
count: 2
43-
path: src/DataFixtures/DailyOccurrenceFixture.php
44-
45-
-
46-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
47-
identifier: arguments.count
48-
count: 13
49-
path: src/DataFixtures/EventFixture.php
50-
51-
-
52-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
53-
identifier: argument.templateType
54-
count: 13
55-
path: src/DataFixtures/EventFixture.php
56-
57-
-
58-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
59-
identifier: arguments.count
60-
count: 9
61-
path: src/DataFixtures/FeedFixtures.php
62-
63-
-
64-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
65-
identifier: argument.templateType
66-
count: 9
67-
path: src/DataFixtures/FeedFixtures.php
68-
69-
-
70-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
71-
identifier: arguments.count
72-
count: 1
73-
path: src/DataFixtures/LocationFixture.php
74-
75-
-
76-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
77-
identifier: argument.templateType
78-
count: 1
79-
path: src/DataFixtures/LocationFixture.php
80-
81-
-
82-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
83-
identifier: arguments.count
84-
count: 1
85-
path: src/DataFixtures/OccurrenceFixture.php
86-
87-
-
88-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
89-
identifier: argument.templateType
90-
count: 1
91-
path: src/DataFixtures/OccurrenceFixture.php
92-
93-
-
94-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
95-
identifier: arguments.count
96-
count: 1
97-
path: src/DataFixtures/OrganizationFixtures.php
98-
99-
-
100-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
101-
identifier: argument.templateType
102-
count: 1
103-
path: src/DataFixtures/OrganizationFixtures.php
104-
105-
-
106-
message: '#^Method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\) invoked with 1 parameter, 2 required\.$#'
107-
identifier: arguments.count
108-
count: 1
109-
path: src/DataFixtures/TagsFixtures.php
110-
111-
-
112-
message: '#^Unable to resolve the template type T in call to method Doctrine\\Common\\DataFixtures\\AbstractFixture\:\:getReference\(\)$#'
113-
identifier: argument.templateType
114-
count: 1
115-
path: src/DataFixtures/TagsFixtures.php
116-
11733
-
11834
message: '#^Call to method DateTimeImmutable\:\:setTimezone\(\) on a separate line has no effect\.$#'
11935
identifier: method.resultUnused

0 commit comments

Comments
 (0)