Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Dec 17, 2024
0 parents commit ccb882b
Show file tree
Hide file tree
Showing 51 changed files with 10,292 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# TS/JS-Files
[*.{ts,js}]
indent_size = 2

# JSON-Files
[*.json]
indent_style = tab

# YAML-Files
[*.{yaml,yml}]
indent_size = 2

# NEON-Files
[*.neon]
indent_size = 2
indent_style = tab
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.github export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.php export-ignore
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/rector.php export-ignore
/renovate.json export-ignore
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Bug report
description: Create a report to help improve this package.
title: "[BUG]"
labels:
- bug
body:
- type: input
id: php-version
attributes:
label: PHP version
description: What PHP version are you using?
placeholder: 'e.g. 8.1.8'
validations:
required: true
- type: input
id: composer-version
attributes:
label: Composer version
description: What Composer version are you using?
placeholder: 'e.g. 2.4.1'
validations:
required: true
- type: input
id: package-version
attributes:
label: Package version
description: What version of this package are you using?
placeholder: 'e.g. 1.0.0'
validations:
required: true
- type: dropdown
id: application
attributes:
label: Application
description: On which platform did the error occur?
options:
- Composer
- Phar
- PHIVE
validations:
required: true
- type: input
id: operating-system
attributes:
label: Operating system
description: What operating system are you using?
placeholder: 'e.g. macOS 12.5.1'
validations:
required: true
- type: textarea
attributes:
label: Current behavior
description: A clear and concise description of what the bug is.
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
- type: textarea
attributes:
label: Steps to reproduce
description: If possible, describe steps to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Feature request
description: Suggest an idea for this project.
title: "[FEATURE]"
labels:
- enhancement
body:
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is.
placeholder: I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: >
A clear and concise description of any alternative solutions or features
you've considered.
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
31 changes: 31 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
changelog:
exclude:
labels:
- duplicate
- 'good first issue'
- 'help wanted'
- invalid
- question
- wontfix
categories:
- title: ⚡ Breaking
labels:
- breaking
- title: 🚀 Improved
labels:
- enhancement
- title: 🚑 Fixed
labels:
- bug
- title: 👷 Changed
labels:
- maintenance
- title: 📖 Documentation
labels:
- documentation
- title: ⚙️ Dependencies
labels:
- dependencies
- title: Other changes
labels:
- "*"
59 changes: 59 additions & 0 deletions .github/workflows/cgl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CGL
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
cgl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
# @todo Switch to PHP 8.4 once PHP-CS-Fixer supports it
php-version: 8.3
tools: composer:v2, composer-require-checker, composer-unused, cs2pr
coverage: none

# Validation
- name: Validate composer.json
run: composer validate

# Install dependencies
- name: Install Composer dependencies
run: composer require --no-progress symfony/config:"^5.4 || ^6.0 || ^7.0" symfony/dependency-injection:"^5.4 || ^6.0 || ^7.0" symfony/yaml:"^5.4 || ^6.0 || ^7.0"

# Check Composer dependencies
- name: Check dependencies
run: composer-require-checker check
- name: Reset composer.json
run: git checkout composer.json composer.lock
- name: Re-install Composer dependencies
uses: ramsey/composer-install@v3
- name: Check for unused dependencies
run: composer-unused

# Linting
- name: Lint composer.json
run: composer lint:composer
- name: Lint Editorconfig
run: composer lint:editorconfig
- name: Lint PHP
run: composer lint:php -- --format=checkstyle | cs2pr

# SCA
- name: SCA PHP
run: composer sca:php -- --error-format github

# Migration
- name: Rector migration
run: composer migration:rector -- --dry-run
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
on:
push:
tags:
- '*'

jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Check if tag is valid
- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
# Create release
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
generateReleaseNotes: true
111 changes: 111 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
name: Tests (PHP ${{ matrix.php-version }} & ${{ matrix.dependencies }} dependencies)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ["8.1", "8.2", "8.3", "8.4"]
dependencies: ["highest", "lowest"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v${{ matrix.composer-version }}
coverage: none

# Install dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

# Run tests
- name: Run tests
run: composer test

coverage:
name: Test coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: pcov

# Install dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: highest

# Run Unit tests
- name: Build coverage directory
run: mkdir -p .build/coverage
- name: Run Unit tests with coverage
run: composer test:coverage

# Upload artifact
- name: Fix coverage path
working-directory: .build/coverage
run: sed -i 's#/home/runner/work/monitoring/monitoring#${{ github.workspace }}#g' clover.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: .build/coverage/clover.xml
retention-days: 7

coverage-report:
name: Report test coverage
runs-on: ubuntu-latest
needs: coverage
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Download artifact
- name: Download coverage artifact
id: download
uses: actions/download-artifact@v4
with:
name: coverage

# CodeClimate
- name: CodeClimate report
uses: paambaati/codeclimate-action@v9.0.0
if: env.CC_TEST_REPORTER_ID
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{ steps.download.outputs.download-path }}/clover.xml:clover
# Coveralls
- name: Coveralls report
uses: coverallsapp/github-action@v2
with:
file: ${{ steps.download.outputs.download-path }}/clover.xml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.build
/vendor
/.php-cs-fixer.cache
/.phpunit.result.cache
Loading

0 comments on commit ccb882b

Please sign in to comment.