Skip to content

Commit 4fe99f0

Browse files
committed
Cleaned up?
1 parent 915863e commit 4fe99f0

File tree

95 files changed

+520
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+520
-136
lines changed

.github/workflows/documentation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: arduino/setup-task@v2
2727
- run: |
28-
task github-actions:update-headers --yes
28+
task github-actions:template-headers-update --yes
2929
# Check that files hav not changed.
3030
- run: |
3131
git diff --exit-code github/workflows/

.markdownlint.jsonc

-1
This file was deleted.

.markdownlint.jsonc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// markdownlint-cli configuration file (cf. https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration)
2+
{
3+
"default": true,
4+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md
5+
"line-length": {
6+
"line_length": 120,
7+
"code_blocks": false,
8+
"tables": false
9+
},
10+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md
11+
"no-duplicate-heading": {
12+
"siblings_only": true
13+
},
14+
// https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections#creating-a-collapsed-section
15+
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md
16+
"no-inline-html": {
17+
"allowed_elements": ["details", "summary"]
18+
}
19+
}

.markdownlintignore

-1
This file was deleted.

.markdownlintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#ignoring-files
2+
vendor/
3+
node_modules/
4+
LICENSE.md
5+
# Drupal
6+
web/*.md
7+
web/core/
8+
web/*/contrib/

Taskfile.yml

+5-54
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
version: '3'
44

5+
includes:
6+
github-actions: ./task/Tasfile.github-actions.yml
7+
58
vars:
69
GITHUB_ACTIONS_TEMPLATES_HEADER: |
710
# Github Actions templates
@@ -16,63 +19,11 @@ vars:
1619
GITHUB_ACTIONS_TEMPLATES_FOOTER: |
1720
1821
tasks:
19-
github-actions:documentation:update:
20-
desc: "Update GitHub Actions template documentation"
21-
sources:
22-
- github/workflows/*.yaml
23-
generates:
24-
- docs/github-action-templates.md
25-
cmds:
26-
- mkdir -p docs
27-
- |
28-
echo '{{.GITHUB_ACTIONS_TEMPLATES_HEADER}}' > docs/github-action-templates.md
29-
- |
30-
for f in github/workflows/*.yaml; do
31-
echo "" >> docs/github-action-templates.md
32-
echo "---" >> docs/github-action-templates.md
33-
echo "" >> docs/github-action-templates.md
34-
35-
echo "[$f]($f)" >> docs/github-action-templates.md
36-
37-
cat "$f" | grep -E '^###( |$)' | sed -E -e 's/^### ?//' >> docs/github-action-templates.md
38-
done
39-
- |
40-
echo "{{.GITHUB_ACTIONS_TEMPLATES_FOOTER}}" >> docs/github-action-templates.md
41-
# Link to clean up.
42-
- task lint:markdown -- docs/github-action-templates.md
43-
44-
github-actions:update-headers:
45-
prompt: "Updating headers may break things, so check result afterwards. Really update headers?"
46-
desc: "Update headers in GitHub Actions templates"
47-
cmds:
48-
- |
49-
for f in github/workflows/*.yaml; do
50-
echo "$f"
51-
# If file starts with `# ` …
52-
if [[ $(head --lines=1 "$f") =~ "^# " ]]; then
53-
# … replace the header.
54-
# This is done by deleting all lines from the top of the file to a blank line.
55-
docker run --rm --volume=$PWD:/app --user ${COMPOSE_USER:-deploy} itkdev/php8.3-fpm:latest sed -i '1,/^$/d' "$f"
56-
fi
57-
58-
# Write header and file into temporary file.
59-
(
60-
echo "# Do not edit this file! Make a pull request on changing";
61-
echo "# $f in";
62-
echo "# https://github.com/itk-dev/devops_itkdev-docker if need be.";
63-
echo "";
64-
cat "$f"
65-
) > "$f.tmp"
66-
# Replace original file with temporary file.
67-
mv "$f.tmp" "$f"
68-
done
69-
7022
lint:markdown:
7123
desc: "Lint Markdown"
7224
cmds:
73-
# I cannot get itkdev/markdownlint to work as expected, i.e. as peterdavehello/markdownlint does …
74-
- docker run --rm --volume "$PWD":/md peterdavehello/markdownlint markdownlint {{.GLOB}} --fix
75-
- docker run --rm --volume "$PWD":/md peterdavehello/markdownlint markdownlint {{.GLOB}}
25+
- docker run --rm --volume "$PWD":/md itkdev/markdownlint markdownlint {{.GLOB}} --fix
26+
- docker run --rm --volume "$PWD":/md itkdev/markdownlint markdownlint {{.GLOB}}
7627
vars:
7728
# We use a block scalar (https://yaml-multiline.info/#block-scalars) here to make escaping (a little) easier.
7829
GLOB: >-

config/drupal/php/phpcs.xml

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
// https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file
3+
$config = new TwigCsFixer\Config\Config();
4+
5+
return $config;

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

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
// https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file
3+
$config = new TwigCsFixer\Config\Config();
4+
5+
return $config;

docs/github-action-templates.md

-69
This file was deleted.

docs/github-actions-templates.md

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<!-- DO NOT EDIT THIS FILE!
2+
3+
It was automatically created by task/github-documentation-update.sh at Thu Apr 3 16:24:27 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](%THIS_REPOSITORY%) and then the project template must be updated to match the new templates.
10+
11+
## Naming conventions
12+
13+
* Named after what a tool is concerned with, not how it's concerned with it.
14+
* Some configuration based on template type (drupal, symfony)
15+
16+
## Templates
17+
18+
---
19+
20+
[github/workflows/changelog.yaml](github/workflows/changelog.yaml)
21+
22+
### Changelog
23+
24+
Checks that changelog has been updated
25+
26+
---
27+
28+
[github/workflows/composer.yaml](github/workflows/composer.yaml)
29+
30+
### Composer
31+
32+
Validates composer.json and checks that it's normalized.
33+
34+
#### Assumptions
35+
36+
1. A docker compose service named `phpfpm` can be run and `composer` can be
37+
run inside the `phpfpm` service.
38+
2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
39+
is a dev requirement in `composer.json`:
40+
41+
``` shell
42+
docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
43+
```
44+
45+
Normalize `composer.json` by running
46+
47+
``` shell
48+
docker compose run --rm phpfpm composer normalize
49+
```
50+
51+
---
52+
53+
[github/workflows/drupal-php.yaml](github/workflows/drupal-php.yaml)
54+
55+
---
56+
57+
[github/workflows/drupal-site.yaml](github/workflows/drupal-site.yaml)
58+
59+
### Drupal
60+
61+
Checks that site can be installed and can be updated (from base branch on
62+
pull request).
63+
64+
#### Assumptions
65+
66+
1. A docker compose service named `phpfpm` can be run and `composer` can be
67+
run inside the `phpfpm` service.
68+
2. The docker setup contains a database container and other the dependent services and the
69+
3. The Drupal site can be installed from existing config.
70+
71+
---
72+
73+
[github/workflows/javascript.yaml](github/workflows/javascript.yaml)
74+
75+
---
76+
77+
[github/workflows/markdown.yaml](github/workflows/markdown.yaml)
78+
79+
### Markdown
80+
81+
Uses [itkdev/markdownlint](https://hub.docker.com/r/itkdev/markdownlint) to
82+
link all Markdown files (`**/*.md`) in the project.
83+
84+
[markdownlint-cli configuration ### files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration),
85+
`.markdownlint.jsonc` and `.markdownlintignore` control what is actually linted and how.
86+
87+
---
88+
89+
[github/workflows/styles.yaml](github/workflows/styles.yaml)
90+
91+
---
92+
93+
[github/workflows/symfony-php.yaml](github/workflows/symfony-php.yaml)
94+
95+
---
96+
97+
[github/workflows/twig.yaml](github/workflows/twig.yaml)
98+
99+
### Twig
100+
101+
Validates Twig files
102+
103+
#### Assumptions
104+
105+
1. A docker compose service named `phpfpm` can be run and `composer` can be
106+
run inside the `phpfpm` service.
107+
2. [vincentlanglet/twig-cs-fixer](https://github.com/VincentLanglet/Twig-CS-Fixer)
108+
is a dev requirement in `composer.json`:
109+
110+
``` shell
111+
docker compose run --rm phpfpm composer require --dev vincentlanglet/twig-cs-fixer
112+
```
113+
114+
3. A [Configuration
115+
file](https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file)
116+
in the root of the project defines which files to check and rules to use.
117+
118+
---

github/workflows/changelog.yaml

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

5-
### ## Changelog
5+
### ### Changelog
66
###
77
### Checks that changelog has been updated
88

github/workflows/composer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# github/workflows/composer.yaml in
33
# https://github.com/itk-dev/devops_itkdev-docker if need be.
44

5-
### ## Composer
5+
### ### Composer
66
###
77
### Validates composer.json and checks that it's normalized.
88
###
9-
### ### Assumptions
9+
### #### Assumptions
1010
###
1111
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
1212
### run inside the `phpfpm` service.

github/workflows/drupal-php.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/drupal-php.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+

github/workflows/drupal.yaml renamed to github/workflows/drupal-site.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Do not edit this file! Make a pull request on changing
2-
# github/workflows/drupal.yaml in
2+
# github/workflows/drupal-site.yaml in
33
# https://github.com/itk-dev/devops_itkdev-docker if need be.
44

5-
### ## Drupal
5+
### ### Drupal
66
###
77
### Checks that site can be installed and can be updated (from base branch on
88
### pull request).
99
###
10-
### ### Assumptions
10+
### #### Assumptions
1111
###
1212
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
1313
### run inside the `phpfpm` service.

github/workflows/javascript.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/javascript.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+

github/workflows/markdown.yaml

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

5-
### ## Markdown
5+
### ### Markdown
66
###
77
### Uses [itkdev/markdownlint](https://hub.docker.com/r/itkdev/markdownlint) to
88
### link all Markdown files (`**/*.md`) in the project.

github/workflows/styles.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/styles.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+

github/workflows/symfony-php.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony-php.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+

0 commit comments

Comments
 (0)