mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Merge pull request #214 from phpDocumentor/feature/improve-ci
Improve ci setup
This commit is contained in:
+100
-39
@@ -9,14 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Restore/cache vendor folder
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: vendor
|
|
||||||
key: all-build-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
all-build-${{ hashFiles('**/composer.lock') }}
|
|
||||||
all-build-
|
|
||||||
- name: Restore/cache tools folder
|
- name: Restore/cache tools folder
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@@ -25,20 +18,24 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
all-tools-${{ github.sha }}-
|
all-tools-${{ github.sha }}-
|
||||||
all-tools-
|
all-tools-
|
||||||
|
|
||||||
- name: composer
|
- name: composer
|
||||||
uses: docker://composer
|
uses: docker://composer
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: install --no-interaction --prefer-dist --optimize-autoloader
|
args: install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
- name: composer-require-checker
|
- name: composer-require-checker
|
||||||
uses: docker://phpga/composer-require-checker-ga
|
uses: docker://phpga/composer-require-checker-ga
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: check --config-file ./composer-require-config.json composer.json
|
args: check --config-file ./composer-require-config.json composer.json
|
||||||
|
|
||||||
- name: Install phive
|
- name: Install phive
|
||||||
run: make install-phive
|
run: make install-phive
|
||||||
|
|
||||||
- name: Install PHAR dependencies
|
- name: Install PHAR dependencies
|
||||||
run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8E730BA25823D8B5 --force-accept-unsigned
|
run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8E730BA25823D8B5 --force-accept-unsigned
|
||||||
|
|
||||||
@@ -48,6 +45,7 @@ jobs:
|
|||||||
needs: setup
|
needs: setup
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Restore/cache vendor folder
|
- name: Restore/cache vendor folder
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@@ -56,6 +54,7 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
all-build-${{ hashFiles('**/composer.lock') }}
|
all-build-${{ hashFiles('**/composer.lock') }}
|
||||||
all-build-
|
all-build-
|
||||||
|
|
||||||
- name: Restore/cache tools folder
|
- name: Restore/cache tools folder
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@@ -64,14 +63,17 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
all-tools-${{ github.sha }}-
|
all-tools-${{ github.sha }}-
|
||||||
all-tools-
|
all-tools-
|
||||||
|
|
||||||
- name: PHPUnit
|
- name: PHPUnit
|
||||||
uses: docker://phpdoc/phpunit-ga:latest
|
uses: docker://phpdoc/phpunit-ga:latest
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Quick check code coverage level
|
- name: Quick check code coverage level
|
||||||
run: php tests/coverage-checker.php 89
|
run: php tests/coverage-checker.php 89
|
||||||
|
|
||||||
phpunit:
|
phpunit:
|
||||||
|
name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -80,20 +82,38 @@ jobs:
|
|||||||
- windows-latest
|
- windows-latest
|
||||||
- macOS-latest
|
- macOS-latest
|
||||||
php-versions: ['7.2', '7.3', '7.4']
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}
|
env:
|
||||||
|
extensions: mbstring
|
||||||
|
key: cache-v1 # can be any string, change to clear the extension cache.
|
||||||
|
|
||||||
needs:
|
needs:
|
||||||
- setup
|
- setup
|
||||||
- phpunit-with-coverage
|
- phpunit-with-coverage
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Restore/cache vendor folder
|
|
||||||
|
- 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/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: ${{ steps.cache-env.outputs.dir }}
|
||||||
key: all-build-${{ hashFiles('**/composer.lock') }}
|
key: ${{ steps.cache-env.outputs.key }}
|
||||||
restore-keys: |
|
|
||||||
all-build-${{ hashFiles('**/composer.lock') }}
|
- name: Setup PHP
|
||||||
all-build-
|
uses: shivammathur/setup-php@master
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extension: ${{ env.extensions }}
|
||||||
|
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
|
||||||
|
|
||||||
- name: Restore/cache tools folder
|
- name: Restore/cache tools folder
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
@@ -102,13 +122,21 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
all-tools-${{ github.sha }}-
|
all-tools-${{ github.sha }}-
|
||||||
all-tools-
|
all-tools-
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@master
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
pecl: false
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
- name: Run PHPUnit
|
- name: Run PHPUnit
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: php tools/phpunit
|
run: php tools/phpunit
|
||||||
@@ -152,30 +180,63 @@ jobs:
|
|||||||
args: analyse src --configuration phpstan.neon
|
args: analyse src --configuration phpstan.neon
|
||||||
|
|
||||||
psalm:
|
psalm:
|
||||||
runs-on: ubuntu-latest
|
name: Psaml
|
||||||
needs: [setup, phpunit]
|
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:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Restore/cache vendor folder
|
|
||||||
|
- 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/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: ${{ steps.cache-env.outputs.dir }}
|
||||||
key: all-build-${{ hashFiles('**/composer.lock') }}
|
key: ${{ steps.cache-env.outputs.key }}
|
||||||
restore-keys: |
|
|
||||||
all-build-${{ hashFiles('**/composer.lock') }}
|
- name: Setup PHP
|
||||||
all-build-
|
uses: shivammathur/setup-php@master
|
||||||
- name: Restore/cache tools folder
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extension: ${{ 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/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: tools
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: all-tools-${{ github.sha }}
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
restore-keys: |
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
all-tools-${{ github.sha }}-
|
|
||||||
all-tools-
|
- name: Install dependencies
|
||||||
- name: Psalm
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
uses: docker://mickaelandrieu/psalm-ga
|
|
||||||
env:
|
- name: Run psalm
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
run: psalm --output-format=github
|
||||||
|
|
||||||
|
|
||||||
bc_check:
|
bc_check:
|
||||||
name: BC Check
|
name: BC Check
|
||||||
|
|||||||
Reference in New Issue
Block a user