mirror of
https://github.com/danog/phpdoc-parser.git
synced 2024-11-30 04:29:20 +01:00
Use GitHub Actions instead of Travis CI
This commit is contained in:
parent
33d5f73f71
commit
f95c617ed5
160
.github/workflows/build.yml
vendored
Normal file
160
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
||||
|
||||
name: "Build"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
|
||||
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"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
|
||||
- name: "Validate Composer"
|
||||
run: "composer validate"
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: "composer install --no-interaction --no-progress --no-suggest"
|
||||
|
||||
- name: "Update PHPUnit"
|
||||
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
|
||||
run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
|
||||
|
||||
|
||||
- name: "Lint"
|
||||
run: "vendor/bin/phing lint"
|
||||
|
||||
coding-standards:
|
||||
name: "Coding Standard"
|
||||
|
||||
runs-on: "ubuntu-latest"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "7.3"
|
||||
|
||||
- name: "Validate Composer"
|
||||
run: "composer validate"
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: "composer install --no-interaction --no-progress --no-suggest"
|
||||
|
||||
- name: "Lint"
|
||||
run: "vendor/bin/phing lint"
|
||||
|
||||
- name: "Coding Standard"
|
||||
run: "vendor/bin/phing cs"
|
||||
|
||||
tests:
|
||||
name: "Tests"
|
||||
runs-on: "ubuntu-latest"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.1"
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
dependencies:
|
||||
- "lowest"
|
||||
- "highest"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
|
||||
- name: "Install lowest dependencies"
|
||||
if: ${{ matrix.dependencies == 'lowest' }}
|
||||
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
|
||||
|
||||
- name: "Install highest dependencies"
|
||||
if: ${{ matrix.dependencies == 'highest' }}
|
||||
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 require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
|
||||
|
||||
- name: "Tests"
|
||||
run: "vendor/bin/phing tests"
|
||||
|
||||
static-analysis:
|
||||
name: "PHPStan"
|
||||
runs-on: "ubuntu-latest"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.1"
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
dependencies:
|
||||
- "lowest"
|
||||
- "highest"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php-version }}"
|
||||
extensions: mbstring
|
||||
tools: composer:v2
|
||||
|
||||
- name: "Install lowest dependencies"
|
||||
if: ${{ matrix.dependencies == 'lowest' }}
|
||||
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
|
||||
|
||||
- name: "Install highest dependencies"
|
||||
if: ${{ matrix.dependencies == 'highest' }}
|
||||
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 require --dev phpunit/phpunit:'^9.5' --update-with-dependencies"
|
||||
|
||||
- name: "PHPStan"
|
||||
run: "vendor/bin/phing phpstan"
|
18
.travis.yml
18
.travis.yml
@ -1,18 +0,0 @@
|
||||
language: php
|
||||
php:
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4
|
||||
- master
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: master
|
||||
|
||||
before_script:
|
||||
- composer self-update
|
||||
- composer update --no-interaction
|
||||
|
||||
script:
|
||||
- vendor/bin/phing
|
@ -1,7 +1,7 @@
|
||||
<h1 align="center">PHPDoc-Parser for PHPStan</h1>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://travis-ci.com/phpstan/phpdoc-parser"><img src="https://api.travis-ci.com/phpstan/phpdoc-parser.svg?branch=master" alt="Build Status"></a>
|
||||
<a href="https://github.com/phpstan/phpdoc-parser/actions"><img src="https://github.com/phpstan/phpdoc-parser/workflows/Build/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/phpstan/phpdoc-parser"><img src="https://poser.pugx.org/phpstan/phpdoc-parser/v/stable" alt="Latest Stable Version"></a>
|
||||
<a href="https://choosealicense.com/licenses/mit/"><img src="https://poser.pugx.org/phpstan/phpstan/license" alt="License"></a>
|
||||
<a href="https://phpstan.org/"><img src="https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat" alt="PHPStan Enabled"></a>
|
||||
@ -27,4 +27,4 @@ Afterwards you can either run the whole build including linting and coding stand
|
||||
|
||||
or run only tests using
|
||||
|
||||
vendor/bin/phing tests
|
||||
vendor/bin/phing tests
|
||||
|
2
build-cs/.gitignore
vendored
Normal file
2
build-cs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/composer.lock
|
||||
/vendor
|
7
build-cs/composer.json
Normal file
7
build-cs/composer.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"require-dev": {
|
||||
"consistence/coding-standard": "^3.5",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
||||
"slevomat/coding-standard": "^4.7.2"
|
||||
}
|
||||
}
|
73
build.xml
73
build.xml
@ -6,7 +6,6 @@
|
||||
composer-install,
|
||||
lint,
|
||||
cs,
|
||||
composer-normalize-check,
|
||||
tests,
|
||||
phpstan
|
||||
"/>
|
||||
@ -33,31 +32,6 @@
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="composer-normalize-check">
|
||||
<exec
|
||||
executable="composer"
|
||||
logoutput="true"
|
||||
passthru="true"
|
||||
checkreturn="true"
|
||||
>
|
||||
<arg value="normalize"/>
|
||||
<arg value="--ansi"/>
|
||||
<arg value="--dry-run"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="composer-normalize-fix">
|
||||
<exec
|
||||
executable="composer"
|
||||
logoutput="true"
|
||||
passthru="true"
|
||||
checkreturn="true"
|
||||
>
|
||||
<arg value="normalize"/>
|
||||
<arg value="--ansi"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="lint">
|
||||
<exec
|
||||
executable="vendor/bin/parallel-lint"
|
||||
@ -77,31 +51,36 @@
|
||||
</target>
|
||||
|
||||
<target name="cs">
|
||||
<php expression="PHP_VERSION_ID >= 70400 ?'true':'false'" returnProperty="isPHP74" level="verbose" />
|
||||
<if>
|
||||
<equals arg1="${isPHP74}" arg2="false" />
|
||||
<then>
|
||||
<exec
|
||||
executable="vendor/bin/phpcs"
|
||||
logoutput="true"
|
||||
passthru="true"
|
||||
checkreturn="true"
|
||||
>
|
||||
<arg value="--extensions=php"/>
|
||||
<arg value="--encoding=utf-8"/>
|
||||
<arg value="--tab-width=4"/>
|
||||
<arg value="--ignore=tests/*/data,tests/*/traits"/>
|
||||
<arg value="-sp"/>
|
||||
<arg path="src"/>
|
||||
<arg path="tests"/>
|
||||
</exec>
|
||||
</then>
|
||||
</if>
|
||||
<exec
|
||||
executable="composer"
|
||||
logoutput="true"
|
||||
passthru="true"
|
||||
checkreturn="true"
|
||||
>
|
||||
<arg value="install"/>
|
||||
<arg value="--working-dir"/>
|
||||
<arg path="build-cs"/>
|
||||
<arg value="--ansi"/>
|
||||
</exec>
|
||||
<exec
|
||||
executable="build-cs/vendor/bin/phpcs"
|
||||
logoutput="true"
|
||||
passthru="true"
|
||||
checkreturn="true"
|
||||
>
|
||||
<arg value="--extensions=php"/>
|
||||
<arg value="--encoding=utf-8"/>
|
||||
<arg value="--tab-width=4"/>
|
||||
<arg value="--ignore=tests/*/data,tests/*/traits"/>
|
||||
<arg value="-sp"/>
|
||||
<arg path="src"/>
|
||||
<arg path="tests"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="cs-fix">
|
||||
<exec
|
||||
executable="vendor/bin/phpcbf"
|
||||
executable="build-cs/vendor/bin/phpcbf"
|
||||
logoutput="true"
|
||||
passthru="true"
|
||||
checkreturn="true"
|
||||
|
@ -6,18 +6,18 @@
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"consistence/coding-standard": "^3.5",
|
||||
"ergebnis/composer-normalize": "^2.0.2",
|
||||
"phing/phing": "^2.16.0",
|
||||
"phing/phing": "^2.16.3",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "^0.12.26",
|
||||
"phpstan/phpstan-strict-rules": "^0.12",
|
||||
"phpunit/phpunit": "^6.3",
|
||||
"slevomat/coding-standard": "^4.7.2",
|
||||
"phpstan/phpstan": "^0.12.60",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.5",
|
||||
"phpunit/phpunit": "^7.5.20",
|
||||
"symfony/process": "^4.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.4.6"
|
||||
},
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="PHPStan PHPDoc Parser">
|
||||
<rule ref="vendor/consistence/coding-standard/Consistence/ruleset.xml">
|
||||
<rule ref="build-cs/vendor/consistence/coding-standard/Consistence/ruleset.xml">
|
||||
<exclude name="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.InvalidFormat"/>
|
||||
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
|
||||
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
|
||||
|
Loading…
Reference in New Issue
Block a user