Skip to content

Commit 0f62b37

Browse files
committed
Updated project template and cleaned up
1 parent 473ae80 commit 0f62b37

48 files changed

Lines changed: 2488 additions & 1031 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is copied from config/symfony/.editorconfig in https://github.com/itk-dev/devops_itkdev-docker.
2+
# Feel free to edit the file, but consider making a pull request if you find a general issue with the file.
3+
4+
# EditorConfig is awesome: https://editorconfig.org
5+
6+
# top-most EditorConfig file
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = LF
12+
indent_size = 4
13+
indent_style = space
14+
insert_final_newline = true
15+
trim_trailing_whitespace = true
16+
17+
[*.{js,css,scss}]
18+
indent_size = 2
19+
20+
[*.{yml,yaml}]
21+
indent_size = 2
22+
23+
[config/**/*.{yml,yaml}]
24+
indent_size = 4

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
###> Docker compose setup ###
1818
COMPOSE_PROJECT_NAME=event-database-imports
1919
COMPOSE_DOMAIN=event-database-imports.local.itkdev.dk
20+
ITKDEV_TEMPLATE=symfony-6
2021
###< Docker compose setup ###
2122

2223
###> symfony/framework-bundle ###

.github/workflows/build_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
tags:
4-
- '*.*.*'
4+
- "*.*.*"
55

66
name: Create Github Release
77

.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: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
46+
- name: Create docker network
47+
run: |
48+
docker network create frontend
49+
50+
- run: |
51+
docker compose run --rm phpfpm composer validate --strict
52+
53+
composer-normalized:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Create docker network
61+
run: |
62+
docker network create frontend
63+
64+
- run: |
65+
docker compose run --rm phpfpm composer install
66+
docker compose run --rm phpfpm composer normalize --dry-run
67+
68+
composer-audit:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
fail-fast: false
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Create docker network
76+
run: |
77+
docker network create frontend
78+
79+
- run: |
80+
docker compose run --rm phpfpm composer audit

.github/workflows/markdown.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
- name: Create docker network
40+
run: |
41+
docker network create frontend
42+
43+
- run: |
44+
docker compose run --rm markdownlint markdownlint '**/*.md'

.github/workflows/php.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
53+
- name: Create docker network
54+
run: |
55+
docker network create frontend
56+
57+
- run: |
58+
docker compose run --rm phpfpm composer install
59+
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command
60+
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff

.github/workflows/pr.yaml

Lines changed: 5 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
php: [ '8.4' ]
9+
php: ["8.4"]
1010
name: Validate composer (${{ matrix.php}})
1111
steps:
1212
- uses: actions/checkout@v4
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
php: [ '8.4' ]
45+
php: ["8.4"]
4646
steps:
4747
- uses: actions/checkout@v4
4848

@@ -77,49 +77,14 @@ jobs:
7777
env:
7878
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7979

80-
php-cs-fixer:
81-
runs-on: ubuntu-latest
82-
strategy:
83-
fail-fast: false
84-
matrix:
85-
php: [ '8.4' ]
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: apcu, ctype, iconv, imagick, json, pdo_sqlsrv, redis, soap, sqlsrv, xmlreader, zip
96-
coverage: none
97-
98-
- name: Get composer cache directory
99-
id: composer-cache
100-
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
101-
102-
- name: Cache dependencies
103-
uses: actions/cache@v4
104-
with:
105-
path: ${{ steps.composer-cache.outputs.dir }}
106-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
107-
restore-keys: ${{ runner.os }}-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: composer coding-standards-check
114-
11580
phpstan:
11681
name: PHPStan (${{ matrix.php }})
11782
runs-on: ubuntu-latest
11883
strategy:
11984
fail-fast: false
12085
matrix:
121-
php: [ '8.4' ]
122-
prefer: [ prefer-stable ]
86+
php: ["8.4"]
87+
prefer: [prefer-stable]
12388
steps:
12489
- uses: actions/checkout@v4
12590

@@ -147,44 +112,14 @@ jobs:
147112
- name: Run PHPStan
148113
run: ./vendor/bin/phpstan
149114

150-
markdownlint:
151-
name: Markdown Lint
152-
runs-on: ubuntu-latest
153-
steps:
154-
- name: Checkout
155-
uses: actions/checkout@v4
156-
- name: npm install
157-
uses: actions/setup-node@v4
158-
with:
159-
node-version: '22'
160-
cache: 'npm'
161-
- run: npm install
162-
- name: markdownlint
163-
run: npm run coding-standards-check
164-
165-
changelog:
166-
runs-on: ubuntu-latest
167-
name: Changelog should be updated
168-
steps:
169-
- name: Checkout
170-
uses: actions/checkout@v4
171-
with:
172-
fetch-depth: 2
173-
174-
- name: Git fetch
175-
run: git fetch
176-
177-
- name: Check that changelog has been updated.
178-
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
179-
180115
validate-doctrine-schema:
181116
runs-on: ubuntu-latest
182117
env:
183118
DATABASE_URL: mysql://db:db@127.0.0.1:3306/db_test?serverVersion=mariadb-10.5.13
184119
strategy:
185120
fail-fast: false
186121
matrix:
187-
php: [ '8.4' ]
122+
php: ["8.4"]
188123
name: Validate Doctrine Schema (PHP ${{ matrix.php}})
189124
services:
190125
mariadb:

0 commit comments

Comments
 (0)