Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/changelog.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### Changelog
###
### Checks that changelog has been updated

name: Changelog

on:
pull_request:

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 2

- name: Git fetch
run: git fetch

- name: Check that changelog has been updated.
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
92 changes: 92 additions & 0 deletions .github/workflows/composer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/composer.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### Composer
###
### Validates composer.json and checks that it's normalized.
###
### #### Assumptions
###
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
### run inside the `phpfpm` service.
### 2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
### is a dev requirement in `composer.json`:
###
### ``` shell
### docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
### ```
###
### Normalize `composer.json` by running
###
### ``` shell
### docker compose run --rm phpfpm composer normalize
### ```

name: Composer

env:
COMPOSE_USER: runner
# https://getcomposer.org/doc/03-cli.md#composer-auth
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"} }'

on:
pull_request:
paths: &paths
- "composer.json"
- "compose.yaml"
push:
branches:
- main
- develop
paths: *paths

jobs:
composer-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- run: |
docker compose run --rm phpfpm composer validate --strict

composer-normalized:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- &composer_install
name: Composer install
run: |
# Create a temporary composer file to install https://github.com/mglaman/composer-drupal-lenient before the real install needs it.
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer init --no-interaction
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
docker compose run --rm --env COMPOSER_AUTH --env COMPOSER=composer.lenient.json phpfpm composer require mglaman/composer-drupal-lenient:^1
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm rm composer.lenient.*
# The real install.
docker compose run --rm --env COMPOSER_AUTH phpfpm composer install --no-blocking

- run: |
docker compose run --rm phpfpm composer normalize --dry-run

composer-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- *composer_install

- run: |
docker compose run --rm phpfpm composer audit
45 changes: 45 additions & 0 deletions .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/markdown.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### Markdown
###
### Lints Markdown files (`**/*.md`) in the project.
###
### [markdownlint-cli configuration
### files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration),
### `.markdownlint.jsonc` and `.markdownlintignore`, control what is actually
### linted and how.
###
### #### Assumptions
###
### 1. A docker compose service named `markdownlint` for running `markdownlint`
### (from
### [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli))
### exists.

name: Markdown

on:
pull_request:
paths: &paths
- "**/*.md"
push:
branches:
- main
- develop
paths: *paths

jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- run: |
docker compose run --rm markdownlint markdownlint '**/*.md'
76 changes: 76 additions & 0 deletions .github/workflows/php.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/drupal-module/php.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### Drupal module PHP
###
### Checks that PHP code adheres to the [Drupal coding
### standards](https://www.drupal.org/docs/develop/standards).
###
### #### Assumptions
###
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
### run inside the `phpfpm` service.
### 2. [drupal/coder](https://www.drupal.org/project/coder) is a dev requirement
### in `composer.json`:
###
### ``` shell
### docker compose run --rm phpfpm composer require --dev drupal/coder
### ```
###
### Clean up and check code by running
###
### ``` shell
### 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](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file)
### > 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`.

name: PHP

env:
COMPOSE_USER: runner
# https://getcomposer.org/doc/03-cli.md#composer-auth
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"} }'

on:
pull_request:
paths: &paths
- "**/*.php"
- "composer.json"
- "compose.yaml"
push:
branches:
- main
- develop
paths: *paths

jobs:
coding-standards:
name: PHP - Check Coding Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Create docker network
run: |
docker network create frontend

- &composer_install
name: Composer install
run: |
# Create a temporary composer file to install https://github.com/mglaman/composer-drupal-lenient before the real install needs it.
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer init --no-interaction
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
docker compose run --rm --env COMPOSER_AUTH --env COMPOSER=composer.lenient.json phpfpm composer require mglaman/composer-drupal-lenient:^1
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm rm composer.lenient.*
# The real install.
docker compose run --rm --env COMPOSER_AUTH phpfpm composer install --no-blocking

- run: |
docker compose run --rm phpfpm vendor/bin/phpcs
149 changes: 0 additions & 149 deletions .github/workflows/pr.yaml

This file was deleted.

Loading
Loading