This repository contains a number of GitHub Actions workflow template files that
are copied to a project when running itkdev-docker-compose template:install. Any changes to the workflows should be
made in this repository and then the project template must be updated
to match the new templates.
- A workflow file is named after what it is concerned with, not how it's concerned with it and which tools are
actually used, i.e. we have a
markdown.yamlfile and not amarkdownlint.yamlfile. - Some workflows are specific to a project type, currently
drupalorsymfony, and these sit in a project type subfolder, e.g.github/workflows/drupal. - Some tools require configuration files, and these sit in the
configfolder. Some tool configuration may be specific to a project type (or make sence only for a specific project type), and these specific config files sit in a project type subfolder, e.g.config/drupal/php/.phpcs.xml.distandconfig/drupal/twig/.twig-cs-fixer.dist.php
The current list of templates is shown in the following sections.
github/workflows/changelog.yaml
Checks that changelog has been updated
github/workflows/composer.yaml
Validates composer.json and checks that it's normalized.
-
A docker compose service named
phpfpmcan be run andcomposercan be run inside thephpfpmservice. -
ergebnis/composer-normalize is a dev requirement in
composer.json:docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
Normalize
composer.jsonby runningdocker compose run --rm phpfpm composer normalize
github/workflows/drupal-module/javascript.yaml
Validates JavaScript files.
- A docker compose service named
prettierfor running Prettier exists.
github/workflows/drupal-module/php.yaml
Checks that PHP code adheres to the Drupal coding standards.
-
A docker compose service named
phpfpmcan be run andcomposercan be run inside thephpfpmservice. -
drupal/coder is a dev requirement in
composer.json:docker compose run --rm phpfpm composer require --dev drupal/coder
Clean up and check code by running
docker compose run --rm phpfpm vendor/bin/phpcbf docker compose run --rm phpfpm vendor/bin/phpcs
Note
The template adds .phpcs.xml.dist as a configuration file for
PHP_CodeSniffer
and this makes it possible to override the actual configuration used in a
project by adding a more important configuration file, e.g. .phpcs.xml.
github/workflows/drupal-module/styles.yaml
Validates styles files.
- A docker compose service named
prettierfor running Prettier exists.
github/workflows/drupal/javascript.yaml
Validates JavaScript files.
- A docker compose service named
prettierfor running Prettier exists.
github/workflows/drupal/php.yaml
Checks that PHP code adheres to the Drupal coding standards.
-
A docker compose service named
phpfpmcan be run andcomposercan be run inside thephpfpmservice. -
drupal/coder is a dev requirement in
composer.json:docker compose run --rm phpfpm composer require --dev drupal/coder
Clean up and check code by running
docker compose run --rm phpfpm vendor/bin/phpcbf docker compose run --rm phpfpm vendor/bin/phpcs
Note
The template adds .phpcs.xml.dist as a configuration file for
PHP_CodeSniffer
and this makes it possible to override the actual configuration used in a
project by adding a more important configuration file, e.g. .phpcs.xml.
github/workflows/drupal/site.yaml
Checks that site can be installed and can be updated (from base branch on pull request).
- A docker compose service named
phpfpmcan be run andcomposercan be run inside thephpfpmservice. - The docker setup contains a database container and other the dependent services and the default settings match connection credentials for these services.
- The Drupal site can be installed from existing config.
github/workflows/drupal/styles.yaml
Validates styles files.
- A docker compose service named
prettierfor running Prettier exists.
github/workflows/markdown.yaml
Lints Markdown files (**/*.md) in the project.
markdownlint-cli configuration
files,
.markdownlint.jsonc and .markdownlintignore, control what is actually
linted and how.
- A docker compose service named
markdownlintfor runningmarkdownlint(from markdownlint-cli) exists.
github/workflows/symfony/javascript.yaml
Validates JavaScript files.
- A docker compose service named
prettierfor running Prettier exists.
github/workflows/symfony/php.yaml
Checks that PHP code adheres to the Symfony coding standards.
-
A docker compose service named
phpfpmcan be run andcomposercan be run inside thephpfpmservice. 2. friendsofphp/php-cs-fixer is a dev requirement incomposer.json:docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
Clean up and check code by running
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff
[!NOTE] The template adds
.php-cs-fixer.dist.phpas a configuration file for PHP CS Fixer and this makes it possible to override the actual configuration used in a project by adding a more important configuration file,.php-cs-fixer.php.
github/workflows/symfony/styles.yaml
Validates styles files.
- A docker compose service named
prettierfor running Prettier exists.
Validates Twig files
-
A docker compose service named
phpfpmcan be run andcomposercan be run inside thephpfpmservice. -
vincentlanglet/twig-cs-fixer is a dev requirement in
composer.json:docker compose run --rm phpfpm composer require --dev vincentlanglet/twig-cs-fixer
-
A Configuration file in the root of the project defines which files to check and rules to use.
Validates YAML files.
- A docker compose service named
prettierfor running Prettier exists.
Symfony's YAML config files use 4 spaces for indentation and single quotes.
Therefore we use a Prettier configuration
file, .prettierrc.yaml, to make
Prettier format YAML files in the config/ folder like Symfony expects.
To update this document, run
task github-actions:documentation:updateEach workflow file must contain a single documentation block with lines starting with ###, e.g.
### ### The title
###
### This template …
###
### See … for details.Important
All lines in the documentation block must start with ### and the documentation block consists of all consecutive
lines starting with ###.