Skip to content

Commit c146d38

Browse files
committed
4268: Updated docker compose setup
1 parent 1226b9f commit c146d38

21 files changed

+407
-848
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
COMPOSE_PROJECT_NAME=event-database-api-2
1818
COMPOSE_DOMAIN=event-database-api.local.itkdev.dk
19+
ITKDEV_TEMPLATE=symfony-6
1920

2021
###> symfony/framework-bundle ###
2122
APP_ENV=dev

.github/workflows/changelog.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/changelog.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Changelog
6+
###
7+
### Checks that changelog has been updated
8+
9+
name: Changelog
10+
11+
on:
12+
pull_request:
13+
14+
jobs:
15+
changelog:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 2
24+
25+
- name: Git fetch
26+
run: git fetch
27+
28+
- name: Check that changelog has been updated.
29+
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

.github/workflows/composer.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/composer.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Composer
6+
###
7+
### Validates composer.json and checks that it's normalized.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
12+
### run inside the `phpfpm` service.
13+
### 2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
14+
### is a dev requirement in `composer.json`:
15+
###
16+
### ``` shell
17+
### docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
18+
### ```
19+
###
20+
### Normalize `composer.json` by running
21+
###
22+
### ``` shell
23+
### docker compose run --rm phpfpm composer normalize
24+
### ```
25+
26+
name: Composer
27+
28+
env:
29+
COMPOSE_USER: root
30+
31+
on:
32+
pull_request:
33+
push:
34+
branches:
35+
- main
36+
- develop
37+
38+
jobs:
39+
composer-validate:
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
steps:
44+
- uses: actions/checkout@v4
45+
- run: |
46+
docker network create frontend
47+
docker compose run --rm phpfpm composer validate --strict
48+
49+
composer-normalized:
50+
runs-on: ubuntu-latest
51+
strategy:
52+
fail-fast: false
53+
steps:
54+
- uses: actions/checkout@v4
55+
- run: |
56+
docker network create frontend
57+
docker compose run --rm phpfpm composer install
58+
docker compose run --rm phpfpm composer normalize --dry-run
59+
60+
composer-audit:
61+
runs-on: ubuntu-latest
62+
strategy:
63+
fail-fast: false
64+
steps:
65+
- uses: actions/checkout@v4
66+
- run: |
67+
docker network create frontend
68+
docker compose run --rm phpfpm composer audit

.github/workflows/javascript.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony/javascript.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Symfony JavaScript (and TypeScript)
6+
###
7+
### Validates JavaScript files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
14+
name: JavaScript
15+
16+
on:
17+
pull_request:
18+
push:
19+
branches:
20+
- main
21+
- develop
22+
23+
jobs:
24+
javascript-lint:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- run: |
33+
docker network create frontend
34+
35+
- run: |
36+
docker compose run --rm prettier 'assets/**/*.js' --check

.github/workflows/markdown.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/markdown.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Markdown
6+
###
7+
### Lints Markdown files (`**/*.md`) in the project.
8+
###
9+
### [markdownlint-cli configuration
10+
### files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration),
11+
### `.markdownlint.jsonc` and `.markdownlintignore`, control what is actually
12+
### linted and how.
13+
###
14+
### #### Assumptions
15+
###
16+
### 1. A docker compose service named `markdownlint` for running `markdownlint`
17+
### (from
18+
### [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli))
19+
### exists.
20+
21+
name: Markdown
22+
23+
on:
24+
pull_request:
25+
push:
26+
branches:
27+
- main
28+
- develop
29+
30+
jobs:
31+
markdown-lint:
32+
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- run: |
40+
docker network create frontend
41+
42+
- run: |
43+
docker compose run --rm markdownlint markdownlint '**/*.md'

.github/workflows/php.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
5+
### ### Symfony PHP
6+
###
7+
### Checks that PHP code adheres to the [Symfony coding
8+
### standards](https://symfony.com/doc/current/contributing/code/standards.html).
9+
###
10+
### #### Assumptions
11+
###
12+
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
13+
### run inside the `phpfpm` service. 2.
14+
### [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
15+
### is a dev requirement in `composer.json`:
16+
###
17+
### ``` shell
18+
### docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
19+
### ```
20+
###
21+
### Clean up and check code by running
22+
###
23+
### ``` shell
24+
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix
25+
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff
26+
### ```
27+
###
28+
### > [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration
29+
### > file for PHP CS
30+
### > Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst)
31+
### > and this makes it possible to override the actual configuration used in a
32+
### > project by adding a more important configuration file, `.php-cs-fixer.php`.
33+
34+
name: Symfony PHP
35+
36+
env:
37+
COMPOSE_USER: root
38+
39+
on:
40+
pull_request:
41+
push:
42+
branches:
43+
- main
44+
- develop
45+
46+
jobs:
47+
coding-standards:
48+
name: PHP - Check Coding Standards
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- run: |
53+
docker network create frontend
54+
docker compose run --rm phpfpm composer install
55+
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command
56+
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff

.github/workflows/pr.yaml

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,6 @@
11
on: pull_request
22
name: Review
33
jobs:
4-
test-composer-install:
5-
runs-on: ubuntu-latest
6-
strategy:
7-
fail-fast: false
8-
matrix:
9-
php: [ '8.3' ]
10-
name: Validate composer (${{ matrix.php}})
11-
steps:
12-
- uses: actions/checkout@v4
13-
14-
- name: Setup PHP, with composer and extensions
15-
uses: shivammathur/setup-php@v2
16-
with:
17-
php-version: ${{ matrix.php}}
18-
extensions: http, ctype, iconv
19-
coverage: none
20-
21-
- name: Get composer cache directory
22-
id: composer-cache
23-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
24-
25-
- name: Cache dependencies
26-
uses: actions/cache@v4
27-
with:
28-
path: ${{ steps.composer-cache.outputs.dir }}
29-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency-version }}-
30-
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}-
31-
32-
- name: Validate composer files
33-
run: composer validate composer.json --strict
34-
35-
- name: Composer install with exported .env variables
36-
run: |
37-
set -a && source .env && set +a
38-
APP_ENV=prod composer install --no-dev -o
39-
404
test-suite:
415
name: Test suite (${{ matrix.php }})
426
runs-on: ubuntu-latest
@@ -77,41 +41,6 @@ jobs:
7741
files: ./coverage/unit.xml
7842
flags: unittests, ${{ matrix.php }}
7943

80-
php-cs-fixer:
81-
runs-on: ubuntu-latest
82-
strategy:
83-
fail-fast: false
84-
matrix:
85-
php: ["8.3"]
86-
name: PHP Coding Standards Fixer (PHP ${{ matrix.php }})
87-
steps:
88-
- name: Checkout
89-
uses: actions/checkout@v4
90-
91-
- name: Setup PHP, with composer and extensions
92-
uses: shivammathur/setup-php@v2
93-
with:
94-
php-version: ${{ matrix.php}}
95-
extensions: http, ctype, iconv
96-
coverage: none
97-
98-
- name: Get composer cache directory
99-
id: composer-cache
100-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
101-
102-
- name: Cache composer dependencies
103-
uses: actions/cache@v4
104-
with:
105-
path: ${{ steps.composer-cache.outputs.dir }}
106-
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
107-
restore-keys: ${{ matrix.php }}-composer-
108-
109-
- name: Install Dependencies
110-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
111-
112-
- name: php-cs-fixer
113-
run: phpdbg -qrr ./vendor/bin/php-cs-fixer fix --dry-run
114-
11544
psalm:
11645
runs-on: ubuntu-latest
11746
strategy:
@@ -147,31 +76,6 @@ jobs:
14776
- name: Psalm
14877
run: ./vendor/bin/psalm --no-cache
14978

150-
markdownlint:
151-
name: Markdown Lint
152-
runs-on: ubuntu-latest
153-
steps:
154-
- name: Checkout
155-
uses: actions/checkout@v4
156-
- name: Get yarn cache directory path
157-
id: yarn-cache-dir-path
158-
run: echo "::set-output name=dir::$(yarn cache dir)"
159-
- name: Cache yarn packages
160-
uses: actions/cache@v4
161-
id: yarn-cache
162-
with:
163-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
164-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
165-
restore-keys: |
166-
${{ runner.os }}-yarn-
167-
- name: Yarn install
168-
uses: actions/setup-node@v2
169-
with:
170-
node-version: '22'
171-
- run: yarn install
172-
- name: markdownlint
173-
run: yarn run coding-standards-check
174-
17579
apispec:
17680
runs-on: ubuntu-latest
17781
name: API Specification validation
@@ -211,18 +115,3 @@ jobs:
211115

212116
- name: Check for changes in specifications
213117
run: git diff --diff-filter=ACMRT --exit-code public/spec.yaml
214-
215-
changelog:
216-
runs-on: ubuntu-latest
217-
name: Changelog should be updated
218-
steps:
219-
- name: Checkout
220-
uses: actions/checkout@v4
221-
with:
222-
fetch-depth: 2
223-
224-
- name: Git fetch
225-
run: git fetch
226-
227-
- name: Check that changelog has been updated.
228-
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

0 commit comments

Comments
 (0)