Skip to content
Draft
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
24 changes: 17 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# Drupal editor configuration normalization
# @see http://editorconfig.org/
# This file is copied from config/symfony/.editorconfig in https://github.com/itk-dev/devops_itkdev-docker.
# Feel free to edit the file, but consider making a pull request if you find a general issue with the file.

# This is the top-most .editorconfig file; do not search in parent directories.
# EditorConfig is awesome: https://editorconfig.org

# top-most EditorConfig file
root = true

# All files.
[*]
charset = utf-8
end_of_line = LF
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,css,scss}]
indent_size = 2

[*.{yml,yaml}]
indent_size = 2

[config/**/*.{yml,yaml}]
indent_size = 4
29 changes: 29 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
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
80 changes: 80 additions & 0 deletions .github/workflows/composer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# 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: root

on:
pull_request:
push:
branches:
- main
- develop

jobs:
composer-validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4

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

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

composer-normalized:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4

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

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

composer-audit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4

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

- run: |
docker compose run --rm phpfpm composer audit
44 changes: 44 additions & 0 deletions .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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:
push:
branches:
- main
- develop

jobs:
markdown-lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4

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

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

### ### Symfony PHP
###
### Checks that PHP code adheres to the [Symfony coding
### standards](https://symfony.com/doc/current/contributing/code/standards.html).
###
### #### Assumptions
###
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
### run inside the `phpfpm` service. 2.
### [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
### is a dev requirement in `composer.json`:
###
### ``` shell
### docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
### ```
###
### Clean up and check code by running
###
### ``` shell
### 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.php` as [a configuration
### > file for PHP CS
### > Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst)
### > 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`.

name: Symfony PHP

env:
COMPOSE_USER: root

on:
pull_request:
push:
branches:
- main
- develop

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

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

- run: |
docker compose run --rm phpfpm composer install
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff
94 changes: 4 additions & 90 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,91 +1,14 @@
on: pull_request
name: Review
jobs:
changelog:
runs-on: ubuntu-latest
name: Changelog should be updated
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
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

test-composer-install:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.3' ]
name: Validate composer (${{ matrix.php}})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
extensions: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Validate composer files
run: composer validate composer.json
- name: Composer install with exported .env variables
run: |
set -a && source .env && set +a
APP_ENV=prod composer install --no-dev -o

coding-standards-php:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.3' ]
name: PHP coding Standards (${{ matrix.php }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
extensions: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: coding-standards-check
run: composer coding-standards-check
name: Review

jobs:
code-analysis-php:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.3' ]
php: ["8.3"]
name: PHP code analysis (${{ matrix.php }})
steps:
- name: Checkout
Expand All @@ -110,21 +33,12 @@ jobs:
- name: code-analysis
run: composer code-analysis

coding-standards-markdown:
runs-on: ubuntu-latest
name: Markdown coding standards
steps:
- name: Checkout
uses: actions/checkout@v4
- name: coding-standards-check
run: docker run --rm --volume ${PWD}:/md peterdavehello/markdownlint markdownlint --ignore vendor --ignore LICENSE.md '**/*.md'

test-unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.3' ]
php: ["8.3"]
name: Run unit tests (${{ matrix.php}})
steps:
- name: Checkout
Expand Down
Loading
Loading