Skip to content

Commit 042a574

Browse files
committed
Updated Symfony workflows
1 parent b53a8fc commit 042a574

File tree

11 files changed

+184
-1
lines changed

11 files changed

+184
-1
lines changed

Taskfile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tasks:
2222
build:
2323
desc: "Build everything"
2424
cmds:
25+
- task: github-actions:template-headers:update
2526
- task: github-actions:documentation:update
2627
- task: github-actions:link
2728
- task: lint:markdown

docs/github-actions-templates.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- DO NOT EDIT THIS FILE!
22
3-
It was automatically created at 2025-05-06T10:12:47+02:00
3+
It was automatically created at 2025-05-07T13:03:25+02:00
44
by task/scripts/github-documentation-update
55
based on /app/task/scripts/../templates/github-actions-templates.md
66
-->
@@ -158,10 +158,63 @@ linted and how.
158158

159159
---
160160

161+
[github/workflows/symfony/javascript.yaml](github/workflows/symfony/javascript.yaml)
162+
163+
### Symfony JavaScript (and TypeScript)
164+
165+
Validates JavaScript files.
166+
167+
#### Assumptions
168+
169+
1. A docker compose service named `prettier` for running
170+
[Prettier](https://prettier.io/) exists.
171+
172+
---
173+
161174
[github/workflows/symfony/php.yaml](github/workflows/symfony/php.yaml)
162175

163176
### Symfony PHP
164177

178+
Checks that PHP code adheres to the [Symfony coding
179+
standards](https://symfony.com/doc/current/contributing/code/standards.html).
180+
181+
#### Assumptions
182+
183+
1. A docker compose service named `phpfpm` can be run and `composer` can be
184+
run inside the `phpfpm` service. 2.
185+
[friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
186+
is a dev requirement in `composer.json`:
187+
188+
``` shell
189+
docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
190+
```
191+
192+
Clean up and check code by running
193+
194+
``` shell
195+
docker compose run --rm phpfpm vendor/bin/phpcbf
196+
docker compose run --rm phpfpm vendor/bin/phpcs
197+
```
198+
199+
> [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration
200+
> file for PHP CS
201+
> Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst)
202+
> and this makes it possible to override the actual configuration used in a
203+
> project by adding a more important configuration file, `.php-cs-fixer.php`.
204+
205+
---
206+
207+
[github/workflows/symfony/styles.yaml](github/workflows/symfony/styles.yaml)
208+
209+
### Symfony Styles (CSS and SCSS)
210+
211+
Validates styles files.
212+
213+
#### Assumptions
214+
215+
1. A docker compose service named `prettier` for running
216+
[Prettier](https://prettier.io/) exists.
217+
165218
---
166219

167220
[github/workflows/twig.yaml](github/workflows/twig.yaml)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony/javascript.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Symfony JavaScript (and TypeScript)
6+
###
7+
### Validates JavaScript files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
14+
name: JavaScript
15+
16+
on:
17+
pull_request:
18+
push:
19+
branches:
20+
- main
21+
- develop
22+
23+
jobs:
24+
javascript-lint:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- run: |
33+
docker network create frontend
34+
35+
- run: |
36+
docker compose run --rm prettier 'assets/**/*.js' --check

github/workflows/symfony/php.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,54 @@
33
# https://github.com/itk-dev/devops_itkdev-docker if need be.
44

55
### ### Symfony PHP
6+
###
7+
### Checks that PHP code adheres to the [Symfony coding
8+
### standards](https://symfony.com/doc/current/contributing/code/standards.html).
9+
###
10+
### #### Assumptions
11+
###
12+
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
13+
### run inside the `phpfpm` service. 2.
14+
### [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
15+
### is a dev requirement in `composer.json`:
16+
###
17+
### ``` shell
18+
### docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
19+
### ```
20+
###
21+
### Clean up and check code by running
22+
###
23+
### ``` shell
24+
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix
25+
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff
26+
### ```
27+
###
28+
### > [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration
29+
### > file for PHP CS
30+
### > Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst)
31+
### > and this makes it possible to override the actual configuration used in a
32+
### > project by adding a more important configuration file, `.php-cs-fixer.php`.
33+
34+
name: Symfony PHP
35+
36+
env:
37+
COMPOSE_USER: root
38+
39+
on:
40+
pull_request:
41+
push:
42+
branches:
43+
- main
44+
- develop
45+
46+
jobs:
47+
coding-standards:
48+
name: PHP - Check Coding Standards
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- run: |
53+
docker network create frontend
54+
docker compose run --rm phpfpm composer install
55+
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command
56+
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff

github/workflows/symfony/styles.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony/styles.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Symfony Styles (CSS and SCSS)
6+
###
7+
### Validates styles files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
14+
name: Styles
15+
16+
on:
17+
pull_request:
18+
push:
19+
branches:
20+
- main
21+
- develop
22+
23+
jobs:
24+
styles-lint:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- run: |
33+
docker network create frontend
34+
35+
- run: |
36+
docker compose run --rm prettier 'assets/**/*.?css' --check
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/symfony/javascript.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/symfony/styles.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/symfony/javascript.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/symfony/styles.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/symfony/javascript.yaml

0 commit comments

Comments
 (0)