-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
334 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,269 @@ | ||
name: "build" | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- ".docs/**" | ||
push: | ||
branches: | ||
- "master" | ||
schedule: | ||
- cron: "0 8 * * 1" # At 08:00 on Monday | ||
|
||
env: | ||
extensions: "json" | ||
cache-version: "1" | ||
composer-version: "v1" | ||
composer-install: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable" | ||
|
||
jobs: | ||
qa: | ||
name: "Quality assurance" | ||
runs-on: "${{ matrix.operating-system }}" | ||
|
||
strategy: | ||
matrix: | ||
php-version: ["7.4"] | ||
operating-system: ["ubuntu-latest"] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Setup PHP cache environment" | ||
id: "extcache" | ||
uses: "shivammathur/cache-extensions@v1" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
key: "${{ env.cache-version }}" | ||
|
||
- name: "Cache PHP extensions" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.extcache.outputs.dir }}" | ||
key: "${{ steps.extcache.outputs.key }}" | ||
restore-keys: "${{ steps.extcache.outputs.key }}" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
tools: "composer:${{ env.composer-version }} " | ||
|
||
- name: "Setup problem matchers for PHP" | ||
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | ||
|
||
- name: "Get Composer cache directory" | ||
id: "composercache" | ||
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | ||
|
||
- name: "Cache PHP dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.composercache.outputs.dir }}" | ||
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "${{ runner.os }}-composer-" | ||
|
||
- name: "Validate Composer" | ||
run: "composer validate" | ||
|
||
- name: "Install dependencies" | ||
run: "${{ env.composer-install }}" | ||
|
||
- name: "Coding Standard" | ||
run: "make cs" | ||
|
||
static-analysis: | ||
name: "Static analysis" | ||
runs-on: "${{ matrix.operating-system }}" | ||
|
||
strategy: | ||
matrix: | ||
php-version: ["7.4"] | ||
operating-system: ["ubuntu-latest"] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Setup PHP cache environment" | ||
id: "extcache" | ||
uses: "shivammathur/cache-extensions@v1" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
key: "${{ env.cache-version }}" | ||
|
||
- name: "Cache PHP extensions" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.extcache.outputs.dir }}" | ||
key: "${{ steps.extcache.outputs.key }}" | ||
restore-keys: "${{ steps.extcache.outputs.key }}" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
tools: "composer:${{ env.composer-version }} " | ||
|
||
- name: "Setup problem matchers for PHP" | ||
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | ||
|
||
- name: "Get Composer cache directory" | ||
id: "composercache" | ||
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | ||
|
||
- name: "Cache PHP dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.composercache.outputs.dir }}" | ||
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "${{ runner.os }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "${{ env.composer-install }}" | ||
|
||
- name: "PHPStan" | ||
run: "make phpstan" | ||
|
||
tests: | ||
name: "Tests" | ||
runs-on: "${{ matrix.operating-system }}" | ||
|
||
strategy: | ||
matrix: | ||
php-version: ["7.2", "7.3", "7.4"] | ||
operating-system: ["ubuntu-latest"] | ||
composer-args: [ "" ] | ||
include: | ||
- php-version: "7.2" | ||
operating-system: "ubuntu-latest" | ||
composer-args: "--prefer-lowest" | ||
- php-version: "8.0" | ||
operating-system: "ubuntu-latest" | ||
composer-args: "" | ||
fail-fast: false | ||
|
||
continue-on-error: "${{ matrix.php-version == '8.0' }}" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Setup PHP cache environment" | ||
id: "extcache" | ||
uses: "shivammathur/cache-extensions@v1" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
key: "${{ env.cache-version }}" | ||
|
||
- name: "Cache PHP extensions" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.extcache.outputs.dir }}" | ||
key: "${{ steps.extcache.outputs.key }}" | ||
restore-keys: "${{ steps.extcache.outputs.key }}" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
tools: "composer:${{ env.composer-version }} " | ||
|
||
- name: "Setup problem matchers for PHP" | ||
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | ||
|
||
- name: "Get Composer cache directory" | ||
id: "composercache" | ||
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | ||
|
||
- name: "Cache PHP dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.composercache.outputs.dir }}" | ||
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "${{ runner.os }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "${{ env.composer-install }} ${{ matrix.composer-args }}" | ||
|
||
- name: "Setup problem matchers for PHPUnit" | ||
run: 'echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"' | ||
|
||
- name: "Tests" | ||
run: "make tests" | ||
|
||
tests-code-coverage: | ||
name: "Tests with code coverage" | ||
runs-on: "${{ matrix.operating-system }}" | ||
|
||
strategy: | ||
matrix: | ||
php-version: ["7.4"] | ||
operating-system: ["ubuntu-latest"] | ||
fail-fast: false | ||
|
||
if: "github.event_name == 'push'" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Setup PHP cache environment" | ||
id: "extcache" | ||
uses: "shivammathur/cache-extensions@v1" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
key: "${{ env.cache-version }}" | ||
|
||
- name: "Cache PHP extensions" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.extcache.outputs.dir }}" | ||
key: "${{ steps.extcache.outputs.key }}" | ||
restore-keys: "${{ steps.extcache.outputs.key }}" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.extensions }}" | ||
tools: "composer:${{ env.composer-version }} " | ||
|
||
- name: "Setup problem matchers for PHP" | ||
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' | ||
|
||
- name: "Get Composer cache directory" | ||
id: "composercache" | ||
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' | ||
|
||
- name: "Cache PHP dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "${{ steps.composercache.outputs.dir }}" | ||
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "${{ runner.os }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "${{ env.composer-install }}" | ||
|
||
- name: "Tests" | ||
run: "make coverage-clover" | ||
|
||
- name: "Coveralls.io" | ||
env: | ||
CI_NAME: github | ||
CI: true | ||
COVERALLS_REPO_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
run: | | ||
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar | ||
php php-coveralls.phar --verbose --config tests/.coveralls.yml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
.PHONY: qa lint cs csf phpstan tests coverage | ||
.PHONY: install qa cs csf phpstan tests coverage-clover coverage-html | ||
|
||
all: | ||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs | ||
install: | ||
composer update | ||
|
||
vendor: composer.json composer.lock | ||
composer install | ||
qa: phpstan cs | ||
|
||
qa: lint phpstan cs | ||
cs: | ||
vendor/bin/codesniffer src tests | ||
|
||
lint: vendor | ||
vendor/bin/linter src tests | ||
|
||
cs: vendor | ||
vendor/bin/codesniffer --exclude=Generic.Files.LineEndings src tests | ||
|
||
csf: vendor | ||
csf: | ||
vendor/bin/codefixer src tests | ||
|
||
phpstan: vendor | ||
phpstan: | ||
vendor/bin/phpstan analyse -l max -c phpstan.neon src | ||
|
||
tests: vendor | ||
vendor/bin/tester -s -p php --colors 1 -C tests | ||
tests: | ||
vendor/bin/tester -s -p php --colors 1 -C tests/cases | ||
|
||
coverage-clover: | ||
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases | ||
|
||
coverage: vendor | ||
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests | ||
coverage-html: | ||
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.html --coverage-src ./src tests/cases |
Oops, something went wrong.