Bump shivammathur/setup-php from 2.4.1 to 2.26.0 #67
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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
name: "Build" | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
env: | |
COMPOSER_ROOT_VERSION: "0.12.x-dev" | |
jobs: | |
lint: | |
name: "Lint" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.1" | |
- "7.2" | |
- "7.3" | |
- "7.4" | |
- "8.0" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:snapshot | |
- name: "Validate Composer" | |
run: "composer validate" | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Transform source code" | |
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' | |
run: php bin/transform-source.php | |
- name: "Lint" | |
run: "vendor/bin/phing lint" | |
coding-standards: | |
name: "Coding Standard" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:snapshot | |
- name: "Validate Composer" | |
run: "composer validate" | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Transform source code" | |
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' | |
run: php bin/transform-source.php | |
- name: "Composer Normalize" | |
run: "vendor/bin/phing composer-normalize-check" | |
- name: "Lint" | |
run: "vendor/bin/phing lint" | |
- name: "Coding Standard" | |
run: "vendor/bin/phing cs" | |
dependency-analysis: | |
name: "Dependency Analysis" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:snapshot | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Composer Require Checker" | |
run: "vendor/bin/phing composer-require-checker" | |
tests: | |
name: "Tests" | |
runs-on: ${{ matrix.operating-system }} | |
continue-on-error: ${{ matrix.php-version == '8.0' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- "7.1" | |
- "7.2" | |
- "7.3" | |
- "7.4" | |
- "8.0" | |
operating-system: [ubuntu-latest, windows-latest] | |
script: | |
- "vendor/bin/phing tests" | |
- "vendor/bin/phing tests-fast-static-reflection" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: pecl, composer:snapshot | |
extensions: ds,mbstring | |
ini-values: memory_limit=512M | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Update PHPUnit" | |
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' | |
run: "composer remove --dev brianium/paratest && composer require phpdocumentor/reflection-docblock:'5.2.0' && composer require --dev phpspec/prophecy:'^1.11.1' && composer require --dev phpunit/phpunit:'^9.3' --update-with-dependencies" | |
- name: "Transform source code" | |
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' | |
run: php bin/transform-source.php | |
- name: "Tests" | |
run: "${{ matrix.script }}" | |
tests-code-coverage: | |
name: "Tests with code coverage" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "pcov" | |
php-version: "7.4" | |
tools: pecl, composer:snapshot | |
extensions: ds | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Tests" | |
run: | | |
composer require pcov/clobber --dev && \ | |
vendor/bin/pcov clobber && \ | |
php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude="~vendor~" vendor/bin/phpunit -c tests/phpunit.xml tests/PHPStan | |
- name: "Codecov.io" | |
env: | |
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" | |
run: "bash <(curl -s https://codecov.io/bash) -f tests/tmp/clover.xml" | |
static-analysis: | |
name: "PHPStan" | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- "7.1" | |
- "7.2" | |
- "7.3" | |
- "7.4" | |
- "8.0" | |
operating-system: [ubuntu-latest, windows-latest] | |
script: | |
- "vendor/bin/phing phpstan" | |
- "vendor/bin/phing phpstan-static-reflection" | |
exclude: | |
- operating-system: windows-latest | |
script: "vendor/bin/phing phpstan-static-reflection" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
extensions: mbstring | |
tools: composer:snapshot | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Update PHPUnit" | |
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' | |
run: "composer remove --dev brianium/paratest && composer require phpdocumentor/reflection-docblock:'5.2.0' && composer require --dev phpspec/prophecy:'^1.11.1' && composer require --dev phpunit/phpunit:'^9.3' --update-with-dependencies" | |
- name: "Transform source code" | |
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' | |
run: php bin/transform-source.php | |
- name: "PHPStan" | |
run: ${{ matrix.script }} | |
static-analysis-with-result-cache: | |
name: "PHPStan with result cache" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
extensions: mbstring | |
tools: composer:snapshot | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Cache Result cache" | |
uses: actions/cache@v2 | |
with: | |
path: ./tmp | |
key: "result-cache-v4" | |
- name: "PHPStan with result cache" | |
run: | | |
vendor/bin/phing phpstan-result-cache | |
bin/phpstan clear-result-cache -c build/phpstan.neon | |
vendor/bin/phing phpstan-result-cache | |
echo -e "\n\n" >> src/TrinaryLogic.php | |
vendor/bin/phing phpstan-result-cache | |
vendor/bin/phing phpstan-result-cache | |
- name: "Upload result cache artifact" | |
uses: actions/upload-artifact@v2.1.1 | |
with: | |
name: resultCache-ubuntu-latest.php | |
path: tmp/resultCache.php | |
result-cache-e2e-tests: | |
name: "Result cache E2E tests" | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
operating-system: [ubuntu-latest, windows-latest] | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
extensions: mbstring | |
ini-values: memory_limit=256M | |
tools: composer:snapshot | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Tests" | |
run: | | |
git clone https://github.com/nikic/PHP-Parser.git tests/e2e/PHP-Parser && git -C tests/e2e/PHP-Parser checkout v3.1.5 && composer install --working-dir tests/e2e/PHP-Parser && vendor/bin/phpunit -c tests/phpunit.xml tests/e2e/ResultCacheEndToEndTest.php | |
compiler-tests: | |
name: "Compiler Tests" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.2" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
- name: "Cache dependencies" | |
uses: "actions/cache@v2" | |
with: | |
path: "~/.composer/cache" | |
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-" | |
- name: "Install dependencies" | |
run: "composer update --no-dev --no-interaction --no-progress --no-suggest" | |
- name: "Transform source code" | |
run: php bin/transform-source.php | |
- name: "Tests" | |
run: | | |
cd compiler && \ | |
composer install --no-interaction && \ | |
vendor/bin/phpunit -c tests/phpunit.xml tests && \ | |
../bin/phpstan analyse -l 8 src tests && \ | |
php bin/compile && \ | |
../tmp/phpstan.phar | |
generate-baseline: | |
name: "Generate baseline" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:snapshot | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Generate baseline" | |
run: | | |
cp phpstan-baseline.neon phpstan-baseline-orig.neon && \ | |
vendor/bin/phing phpstan-generate-baseline && \ | |
diff phpstan-baseline.neon phpstan-baseline-orig.neon | |
e2e-tests: | |
name: "E2E tests" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
include: | |
- script: "bin/phpstan analyse -l 8 -a tests/e2e/data/timecop.php tests/e2e/data/timecop.php" | |
tools: "pecl" | |
extensions: "timecop-beta" | |
- script: "bin/phpstan analyse -l 8 -a tests/e2e/data/soap.php tests/e2e/data/soap.php" | |
extensions: "soap" | |
- script: "bin/phpstan analyse -l 8 -a tests/e2e/data/soap.php tests/e2e/data/soap.php" | |
extensions: "" | |
- script: "bin/phpstan analyse -l 8 -c tests/e2e/magic-setter/test.neon tests/e2e/magic-setter/test.php" | |
extensions: "" | |
- script: "bin/phpstan analyse -l 8 tests/e2e/anon-class/Granularity.php" | |
extensions: "" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2.3.2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@2.26.0" | |
with: | |
coverage: "none" | |
php-version: "7.4" | |
tools: ${{ matrix.tools }}, composer:snapshot | |
extensions: ${{ matrix.extensions }} | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress --no-suggest" | |
- name: "Test" | |
run: ${{ matrix.script }} |