Skip to content
Draft
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
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Bug Report
about: Create a report to help us improve
labels: bug
---

**Describe your environment** Describe any aspect of your environment relevant to the problem, including your php version (`php -v` will tell you your current version), version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on master.

**Steps to reproduce** Describe exactly how to reproduce the error. Include a code sample if applicable.

**What is the expected behavior?** What did you expect to see?

**What is the actual behavior?** What did you see instead?

**Additional context** Add any other context about the problem here.
13 changes: 13 additions & 0 deletions .github/phpcs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}")
GIT_ROOT_DIR=$(git rev-parse --show-toplevel)

if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then
EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}");
else
EXTRA_ARGS='';
fi

echo php-cs-fixer binary : ${GIT_ROOT_DIR}/vendor/bin/php-cs-fixer
echo php-cs-fixer config file: ${GIT_ROOT_DIR}/.php_cs.dist
${GIT_ROOT_DIR}/vendor/bin/php-cs-fixer fix --config=${GIT_ROOT_DIR}/.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}
40 changes: 40 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Changelog

on:
pull_request:
types: [closed]

release:
types: [published]

issues:
types: [closed, edited]

jobs:
generate_changelog:
runs-on: ubuntu-latest
name: Generate changelog for master branch
steps:
- uses: actions/checkout@v1

- name: Generate changelog
uses: charmixer/auto-changelog-action@v1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit files
env:
CI_USER: ${{ secrets.GITHUB_USER }}
CI_EMAIL: ${{ secrets.GITHUB_EMAIL }}
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"

- name: Push changes
if: env.push == 1
env:
CI_USER: ${{ secrets.GITHUB_USER }}
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master
57 changes: 57 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: PHP Composer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4']

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
tools: php-cs-fixer
extensions: ast

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Check Style
run: vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no

- name: Run Phan
env:
PHAN_DISABLE_XDEBUG_WARN: 1
run: vendor/bin/phan

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

- name: Code Coverage
run: bash <(curl -s https://codecov.io/bash)
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.idea
composer.phar
composer.lock
/vendor/
/.idea/
/.php_cs
/.php_cs.cache
/.phpunit.result.cache

*.iml
*.DS_Store
Loading