generated from itk-dev/drupal-11-template
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (52 loc) · 1.66 KB
/
php.yaml
File metadata and controls
59 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Do not edit this file! Make a pull request on changing
# github/workflows/drupal/php.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.
### ### Drupal 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
on:
pull_request:
push:
branches:
- main
- develop
jobs:
coding-standards:
name: PHP - Check Coding Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Create docker network
run: |
docker network create frontend
- run: |
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm vendor/bin/phpcs