mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed. This is useful if, for instance, an external action script or composer dependency has broken. Once a fix is available, failing builds for open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow. Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
231 lines
6.6 KiB
YAML
231 lines
6.6 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
# Allow manually triggering the workflow.
|
|
workflow_dispatch:
|
|
name: Qa workflow
|
|
env:
|
|
phiveGPGKeys: 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8A03EA3B385DBAA1
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: composer
|
|
uses: docker://composer
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
args: install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: composer-require-checker
|
|
uses: docker://phpga/composer-require-checker-ga
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
args: check --config-file ./composer-require-config.json composer.json
|
|
|
|
phpunit-with-coverage:
|
|
runs-on: ubuntu-latest
|
|
name: Unit tests
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: composer
|
|
uses: docker://composer
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
args: install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: PHPUnit
|
|
uses: docker://phpdoc/phpunit-ga:latest
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Quick check code coverage level
|
|
run: php tests/coverage-checker.php 91
|
|
|
|
phpunit:
|
|
name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
|
|
runs-on: ${{ matrix.operating-system }}
|
|
strategy:
|
|
matrix:
|
|
operating-system:
|
|
- ubuntu-latest
|
|
- windows-latest
|
|
- macOS-latest
|
|
php-versions: ['7.2', '7.3', '7.4', '8.0']
|
|
env:
|
|
extensions: mbstring
|
|
key: cache-v1 # can be any string, change to clear the extension cache.
|
|
|
|
needs:
|
|
- setup
|
|
- phpunit-with-coverage
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup cache environment
|
|
id: cache-env
|
|
uses: shivammathur/cache-extensions@v1
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: ${{ env.extensions }}
|
|
key: ${{ env.key }}
|
|
|
|
- name: Cache extensions
|
|
uses: actions/[email protected]
|
|
with:
|
|
path: ${{ steps.cache-env.outputs.dir }}
|
|
key: ${{ steps.cache-env.outputs.key }}
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: ${{ env.extensions }}
|
|
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
|
|
tools: phive
|
|
|
|
- name: Install PHAR dependencies
|
|
env:
|
|
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} --force-accept-unsigned
|
|
|
|
- name: Install phpunit 8 for php 7.2
|
|
if: matrix.php-versions == '7.2'
|
|
env:
|
|
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: phive --no-progress install --copy --trust-gpg-keys ${{ env.phiveGPGKeys }} phpunit:^8.5
|
|
|
|
- name: Get composer cache directory
|
|
id: composer-cache
|
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/[email protected]
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run PHPUnit
|
|
continue-on-error: true
|
|
run: php tools/phpunit
|
|
|
|
codestyle:
|
|
runs-on: ubuntu-latest
|
|
needs: [setup, phpunit]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Restore/cache vendor folder
|
|
uses: actions/[email protected]
|
|
with:
|
|
path: vendor
|
|
key: all-build-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
all-build-${{ hashFiles('**/composer.lock') }}
|
|
all-build-
|
|
- name: Code style check
|
|
uses: phpDocumentor/coding-standard@latest
|
|
with:
|
|
args: -s
|
|
|
|
phpstan:
|
|
runs-on: ubuntu-latest
|
|
needs: [setup, phpunit]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: composer
|
|
uses: docker://composer
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
args: install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: PHPStan
|
|
uses: phpDocumentor/[email protected]
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
args: analyse src --configuration phpstan.neon
|
|
|
|
psalm:
|
|
name: Psalm
|
|
runs-on: ${{ matrix.operating-system }}
|
|
strategy:
|
|
matrix:
|
|
operating-system:
|
|
- ubuntu-latest
|
|
php-versions: ['7.2']
|
|
env:
|
|
extensions: mbstring
|
|
key: cache-v1 # can be any string, change to clear the extension cache.
|
|
|
|
needs:
|
|
- setup
|
|
- phpunit
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup cache environment
|
|
id: cache-env
|
|
uses: shivammathur/cache-extensions@v1
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: ${{ env.extensions }}
|
|
key: ${{ env.key }}
|
|
|
|
- name: Cache extensions
|
|
uses: actions/[email protected]
|
|
with:
|
|
path: ${{ steps.cache-env.outputs.dir }}
|
|
key: ${{ steps.cache-env.outputs.key }}
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: ${{ env.extensions }}
|
|
tools: psalm
|
|
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
|
|
|
|
- name: Get composer cache directory
|
|
id: composer-cache
|
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/[email protected]
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run psalm
|
|
run: psalm --output-format=github
|
|
|
|
|
|
bc_check:
|
|
name: BC Check
|
|
runs-on: ubuntu-latest
|
|
needs: [setup, phpunit]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: fetch tags
|
|
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
- name: BC Check
|
|
uses: docker://nyholm/roave-bc-check-ga
|