Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Jul 25, 2023
0 parents commit 40173de
Show file tree
Hide file tree
Showing 34 changed files with 1,705 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2
35 changes: 35 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file tells which files and directories should be ignored and
# NOT downloaded when using composer to pull down a project with
# the --prefer-dist option selected. Used to remove development
# specific files so user has a clean download.

# git files
.gitattributes export-ignore
.gitignore export-ignore

# Don't give admin files
.github/ export-ignore
admin/ export-ignore
contributing/ export-ignore
.editorconfig export-ignore
.nojekyll export-ignore export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore

# They don't want our test files
tests/AutoReview/ export-ignore
tests/system/ export-ignore
utils/ export-ignore
deptrac.yaml export-ignore
rector.php export-ignore
phpunit.xml.dist export-ignore
phpstan-baseline.neon.dist export-ignore
phpstan.neon.dist export-ignore
phpstan-bootstrap.php export-ignore
.php-cs-fixer.dist.php export-ignore
.php-cs-fixer.no-header.php export-ignore
.php-cs-fixer.user-guide.php export-ignore

# The source user guide, either
user_guide_src/ export-ignore
phpdoc.dist.xml export-ignore
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
23 changes: 23 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
changelog:
exclude:
authors:
- dependabot
categories:
- title: Breaking Changes
labels:
- 'breaking change'
- title: Fixed Bugs
labels:
- bug
- title: New Features
labels:
- 'new feature'
- title: Enhancements
labels:
- enhancement
- title: Refactoring
labels:
- refactor
- title: Others (Only for checking. Remove this category)
labels:
- "*"
74 changes: 74 additions & 0 deletions .github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deptrac

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'depfile.yaml'
- '.github/workflows/deptrac.yml'
push:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'depfile.yaml'
- '.github/workflows/deptrac.yml'

jobs:
build:
name: Dependency Tracing
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phive
extensions: intl, json, mbstring, xml
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Create Deptrac cache directory
run: mkdir -p build/

- name: Cache Deptrac results
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-deptrac-${{ github.sha }}
restore-keys: ${{ runner.os }}-deptrac-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Trace dependencies
run: |
sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac
deptrac analyze --cache-file=build/deptrac.cache
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docs

on:
push:
branches:
- develop
paths:
- 'docs/*'
- 'mkdocs.yml'

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
36 changes: 36 additions & 0 deletions .github/workflows/phpcpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHPCPD

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- '.github/workflows/phpcpd.yml'
push:
branches:
- develop
paths:
- '**.php'
- '.github/workflows/phpcpd.yml'

jobs:
build:
name: Code Copy-Paste Detection
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpcpd
extensions: dom, mbstring
coverage: none

- name: Detect duplicate code
run: phpcpd app/ tests/
55 changes: 55 additions & 0 deletions .github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: PHPCSFixer

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- '.github/workflows/phpcsfixer.yml'
push:
branches:
- develop
paths:
- '**.php'
- '.github/workflows/phpcsfixer.yml'

jobs:
build:
name: Coding Standards
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: json, tokenizer
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Check code for standards compliance
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
74 changes: 74 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: PHPStan

on:
pull_request:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'phpstan*'
- '.github/workflows/phpstan.yml'
push:
branches:
- develop
paths:
- '**.php'
- 'composer.*'
- 'phpstan*'
- '.github/workflows/phpstan.yml'

jobs:
build:
name: PHP ${{ matrix.php-versions }} Static Analysis
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1']

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpstan, phpunit
extensions: intl, json, mbstring, xml
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Create PHPStan cache directory
run: mkdir -p build/phpstan

- name: Cache PHPStan results
uses: actions/cache@v3
with:
path: build/phpstan
key: ${{ runner.os }}-phpstan-${{ github.sha }}
restore-keys: ${{ runner.os }}-phpstan-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi
- name: Run static analysis
run: vendor/bin/phpstan analyze

0 comments on commit 40173de

Please sign in to comment.