Skip to content

Commit ceb3413

Browse files
committed
More clean up
1 parent c26f25a commit ceb3413

File tree

32 files changed

+110
-95
lines changed

32 files changed

+110
-95
lines changed

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
version: '3'
44

55
includes:
6-
github-actions: ./task/Tasfile.github-actions.yml
6+
github-actions: ./task/Taskfile.github-actions.yml
77

88
vars:
99
GITHUB_ACTIONS_TEMPLATES_HEADER: |

config/drupal/twig/.twig-cs-fixer.dist.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
// https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file
33

44
$finder = new TwigCsFixer\File\Finder();
5-
6-
if (glob('web/*/custom/*/templates')) {
7-
$finder->in('web/*/custom/*/templates');
8-
}
9-
// Include sub-modules or sub-themes
10-
if (glob('web/*/custom/*/*/templates')) {
11-
$finder->in('web/*/custom/*/*/templates');
12-
}
5+
// Check all files …
6+
$finder->in(__DIR__);
7+
// … that are not ignored by VSC
8+
$finder->ignoreVCSIgnored(true);
139

1410
$config = new TwigCsFixer\Config\Config();
1511
$config->setFinder($finder);

config/symfony/twig/.twig-cs-fixer.dist.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file
33

44
$finder = new TwigCsFixer\File\Finder();
5-
$finder->in('templates');
5+
// Check all files …
6+
$finder->in(__DIR__);
7+
// … that are not ignored by VSC
8+
$finder->ignoreVCSIgnored(true);
69

710
$config = new TwigCsFixer\Config\Config();
811
$config->setFinder($finder);

docs/github-actions-templates.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- DO NOT EDIT THIS FILE!
22
3-
It was automatically created by task/github-documentation-update.sh at Fri Apr 4 13:49:36 CEST 2025.
3+
It was automatically created by task/scripts/github-documentation-update.sh at Tue Apr 8 09:34:35 CEST 2025.
44
-->
55
# Github Actions templates
66

@@ -18,46 +18,30 @@ to match the new templates.
1818

1919
---
2020

21-
[github/workflows/changelog.yaml](github/workflows/changelog.yaml)
22-
23-
### Changelog
24-
25-
Checks that changelog has been updated
26-
27-
---
28-
29-
[github/workflows/composer.yaml](github/workflows/composer.yaml)
21+
[github/workflows/twig.yaml](github/workflows/twig.yaml)
3022

31-
### Composer
23+
### Twigt
3224

33-
Validates composer.json and checks that it's normalized.
25+
Validates Twig files
3426

3527
#### Assumptions
3628

3729
1. A docker compose service named `phpfpm` can be run and `composer` can be
3830
run inside the `phpfpm` service.
39-
2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
31+
2. [vincentlanglet/twig-cs-fixer](https://github.com/VincentLanglet/Twig-CS-Fixer)
4032
is a dev requirement in `composer.json`:
4133

4234
``` shell
43-
docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
44-
```
45-
46-
Normalize `composer.json` by running
47-
48-
``` shell
49-
docker compose run --rm phpfpm composer normalize
35+
docker compose run --rm phpfpm composer require --dev vincentlanglet/twig-cs-fixer
5036
```
5137

52-
---
53-
54-
[github/workflows/drupal-php.yaml](github/workflows/drupal-php.yaml)
55-
56-
Drupal PHP
38+
3. A [Configuration
39+
file](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file)
40+
in the root of the project defines which files to check and rules to use.
5741

5842
---
5943

60-
[github/workflows/drupal-site.yaml](github/workflows/drupal-site.yaml)
44+
[github/workflows/drupal/site.yaml](github/workflows/drupal/site.yaml)
6145

6246
### Drupal
6347

@@ -73,9 +57,9 @@ pull request).
7357

7458
---
7559

76-
[github/workflows/javascript.yaml](github/workflows/javascript.yaml)
60+
[github/workflows/drupal/php.yaml](github/workflows/drupal/php.yaml)
7761

78-
JavaScript (and TypeScript)
62+
Drupal PHP
7963

8064
---
8165

@@ -91,37 +75,53 @@ link all Markdown files (`**/*.md`) in the project.
9175

9276
---
9377

94-
[github/workflows/styles.yaml](github/workflows/styles.yaml)
78+
[github/workflows/javascript.yaml](github/workflows/javascript.yaml)
9579

96-
Styles (CSS and SCSS)
80+
JavaScript (and TypeScript)
9781

9882
---
9983

100-
[github/workflows/symfony-php.yaml](github/workflows/symfony-php.yaml)
84+
[github/workflows/styles.yaml](github/workflows/styles.yaml)
10185

102-
Symfony PHP
86+
Styles (CSS and SCSS)
10387

10488
---
10589

106-
[github/workflows/twig.yaml](github/workflows/twig.yaml)
90+
[github/workflows/composer.yaml](github/workflows/composer.yaml)
10791

108-
### Twigt
92+
### Composer
10993

110-
Validates Twig files
94+
Validates composer.json and checks that it's normalized.
11195

11296
#### Assumptions
11397

11498
1. A docker compose service named `phpfpm` can be run and `composer` can be
11599
run inside the `phpfpm` service.
116-
2. [vincentlanglet/twig-cs-fixer](https://github.com/VincentLanglet/Twig-CS-Fixer)
100+
2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
117101
is a dev requirement in `composer.json`:
118102

119103
``` shell
120-
docker compose run --rm phpfpm composer require --dev vincentlanglet/twig-cs-fixer
104+
docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
121105
```
122106

123-
3. A [Configuration
124-
file](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file)
125-
in the root of the project defines which files to check and rules to use.
107+
Normalize `composer.json` by running
108+
109+
``` shell
110+
docker compose run --rm phpfpm composer normalize
111+
```
112+
113+
---
114+
115+
[github/workflows/symfony/php.yaml](github/workflows/symfony/php.yaml)
116+
117+
Symfony PHP
118+
119+
---
120+
121+
[github/workflows/changelog.yaml](github/workflows/changelog.yaml)
122+
123+
### Changelog
124+
125+
Checks that changelog has been updated
126126

127127
---
File renamed without changes.
File renamed without changes.
File renamed without changes.

github/workflows/twig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# github/workflows/twig.yaml in
33
# https://github.com/itk-dev/devops_itkdev-docker if need be.
44

5-
### ### Twigt
5+
### ### Twig
66
###
77
### Validates Twig files
88
###

task/Tasfile.github-actions.yml renamed to task/Taskfile.github-actions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tasks:
66
cmds:
77
- task: run-script
88
vars:
9-
SCRIPT: task/github-documentation-update.sh
9+
SCRIPT: github-documentation-update
1010
- SKIP_FIX=1 task lint:markdown -- docs/github-actions-templates.md
1111

1212
documentation:diff:
@@ -45,7 +45,7 @@ tasks:
4545
if [[ $(head --lines=1 "$f") =~ "^# " ]]; then
4646
# … replace the header.
4747
# This is done by deleting all lines from the top of the file to a blank line.
48-
docker run --rm --volume=$PWD:/app --user ${COMPOSE_USER:-deploy} itkdev/php8.3-fpm:latest sed -i '1,/^$/d' "$f"
48+
docker run --rm --volume=$PWD:/app --user ${COMPOSE_USER:-deploy} itkdev/php8.4-fpm:latest sed -i '1,/^$/d' "$f"
4949
fi
5050
5151
# Write header and file into temporary file.
@@ -66,7 +66,7 @@ tasks:
6666
cmds:
6767
- task: run-script
6868
vars:
69-
SCRIPT: task/github-actions-link.sh
69+
SCRIPT: github-actions-link
7070
silent: true
7171

7272
show:
@@ -78,7 +78,7 @@ tasks:
7878
run-script:
7979
internal: true
8080
cmds:
81-
- docker run --rm --volume "$PWD:/app" --user ${COMPOSE_USER:-deploy} itkdev/php8.3-fpm:latest {{.SCRIPT}}
81+
- docker run --rm --volume "$PWD:/app" --user ${COMPOSE_USER:-deploy} itkdev/php8.4-fpm:latest task/scripts/{{.SCRIPT}}
8282
requires:
8383
vars:
8484
- SCRIPT
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- DO NOT EDIT THIS FILE!
2+
3+
It was automatically created by task/scripts/github-documentation-update.sh at Tue Apr 8 09:33:44 CEST 2025.
4+
-->
5+
# Github Actions templates
6+
7+
This repository contains a number of [GitHub Actions](https://docs.github.com/en/actions) workflow template files that
8+
are copied to a project when running `itkdev-docker-compose template:install`. Any changes to the workflows should be
9+
made in [this repository](https://github.com/itk-dev/devops_itkdev-docker) and then the project template must be updated
10+
to match the new templates.
11+
12+
## Naming conventions
13+
14+
* Named after what a tool is concerned with, not how it's concerned with it.
15+
* Some configuration based on template type (drupal, symfony)
16+
17+
## Templates
18+
19+
---
20+
21+
[github/workflows/*.yaml](github/workflows/*.yaml)
22+
23+
24+
---

0 commit comments

Comments
 (0)