Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: clean-up project structure #550

Merged
merged 11 commits into from
Jun 7, 2024
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
6 changes: 1 addition & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/.build export-ignore
/.github export-ignore
/.phive export-ignore
/docs export-ignore
/tests export-ignore
.editorconfig export-ignore
.env export-ignore
Expand All @@ -10,18 +9,15 @@
.gitignore export-ignore
.php-cs-fixer.dist.php export-ignore
.pre-commit-config.yaml export-ignore
.yamllint.yaml export-ignore
composer.lock export-ignore
composer-require-checker.json export-ignore
docker-compose.yaml export-ignore
infection.json.dist export-ignore
Makefile export-ignore
package.json export-ignore
pest.xml.dist export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
phpunit.xml.dist export-ignore
psalm.xml export-ignore
psalm-baseline.xml export-ignore
renovate.json export-ignore
rector.php export-ignore
renovate.json export-ignore
2 changes: 1 addition & 1 deletion .markdownlint.json → .github/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.34.0/schema/markdownlint-config-schema.json",
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
"line-length": false,
"no-inline-html": false,
"first-line-h1": false,
Expand Down
1 change: 0 additions & 1 deletion .yamllint.yaml → .github/.yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ extends: default
ignore: |
.build/
vendor/
docs/

rules:
braces:
Expand Down
287 changes: 206 additions & 81 deletions .github/CONTRIBUTING.md

Large diffs are not rendered by default.

File renamed without changes
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

"type: documentation":
- changed-files:
- any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']
- any-glob-to-any-file: ['.github/*', './*.md']

"type: maintenance":
- changed-files:
Expand Down
3 changes: 2 additions & 1 deletion renovate.json → .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
"config:base",
":semanticCommitTypeAll(deps)"
],
"automerge": true,
"platformAutomerge": true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/apply-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: 🏷️ Add labels

jobs:
label:
uses: wayofdev/gh-actions/.github/workflows/[email protected].0
uses: wayofdev/gh-actions/.github/workflows/[email protected].1
with:
os: ubuntu-latest
secrets:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/auto-merge-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master

permissions:
pull-requests: write
Expand All @@ -13,7 +15,7 @@ name: 🤞 Auto merge release

jobs:
auto-merge:
uses: wayofdev/gh-actions/.github/workflows/[email protected].0
uses: wayofdev/gh-actions/.github/workflows/[email protected].1
with:
os: ubuntu-latest
pull-request-number: ${{ github.event.pull_request.number }}
Expand Down
197 changes: 197 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---

on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master
push:
branches:
- master

name: 🧹 Fix PHP coding standards

jobs:
commit-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🧐 Lint commits using "commitlint"
uses: wagoid/[email protected]
with:
configFile: ${{ github.workspace }}/.github/.commitlint.config.mjs
failOnWarnings: false
failOnErrors: true
helpURL: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'

yaml-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🧐 Lint YAML files
uses: ibiqlik/[email protected]
with:
config_file: .github/.yamllint.yaml
file_or_dir: '.'
strict: true

markdown-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: markdown-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🧐 Lint Markdown files
uses: DavidAnson/[email protected]
with:
config: '.github/.markdownlint.json'
globs: |
**/*.md
!CHANGELOG.md

composer-linting:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: composer-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
strategy:
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked
permissions:
contents: write
steps:
- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, phar, fileinfo, curl
ini-values: error_reporting=E_ALL
coverage: none
tools: phive

- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 📥 Install dependencies with phive
uses: wayofdev/gh-actions/actions/phive/[email protected]
with:
phive-home: '.phive'
trust-gpg-keys: 0xC00543248C87FB13,0x033E5F8D801A2F8D

- name: 🔍 Run ergebnis/composer-normalize
run: .phive/composer-normalize --ansi --dry-run

coding-standards:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: coding-standards-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
strategy:
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked
permissions:
contents: write
steps:
- name: ⚙️ Set git to use LF line endings
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, curl
ini-values: error_reporting=E_ALL
coverage: none

- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 🛠️ Prepare environment
run: make prepare

- name: 🚨 Run coding standards task
run: composer cs:fix
env:
PHP_CS_FIXER_IGNORE_ENV: true

- name: 📤 Commit and push changed files back to GitHub
uses: stefanzweifel/[email protected]
with:
commit_message: 'style(php-cs-fixer): lint php files and fix coding standards'
branch: ${{ github.head_ref }}
commit_author: 'github-actions <[email protected]>'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/create-arch-diagram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions: read-all

jobs:
codesee:
uses: wayofdev/gh-actions/.github/workflows/[email protected].0
uses: wayofdev/gh-actions/.github/workflows/[email protected].1
with:
os: ubuntu-latest
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🎉 Create release
uses: google-github-actions/release-please-action@v4
uses: googleapis/release-please-action@v4.1.1
id: release
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/dependency-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---

on: # yamllint disable-line rule:truthy
push:
branches:
- master
paths:
- 'config/**'
- 'src/**'
- 'tests/**'
- '.php-cs-fixer.dist.php'
- 'composer.*'
pull_request:
branches:
- master
paths:
- 'config/**'
- 'src/**'
- 'tests/**'
- '.php-cs-fixer.dist.php'
- 'composer.*'

name: 🔐 Dependency analysis

jobs:
dependency-analysis:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: dependency-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked

steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo
ini-values: error_reporting=E_ALL
coverage: none
tools: phive

- name: 🛠️ Setup problem matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 📥 Install dependencies with phive
uses: wayofdev/gh-actions/actions/phive/[email protected]
with:
phive-home: '.phive'
trust-gpg-keys: 0xC00543248C87FB13,0x033E5F8D801A2F8D

- name: 🔬 Run maglnet/composer-require-checker
run: .phive/composer-require-checker check --ansi --config-file="$(pwd)/composer-require-checker.json" --verbose
Loading