From fd10509b08dd5b6e171eafaecb92774b79b5b38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zdene=CC=8Ck=20Drahos=CC=8C?= Date: Tue, 2 Feb 2021 10:21:51 +0100 Subject: [PATCH] CI - deprecate travis - long running builds, at least 1h (https://travis-ci.org/github/EdgedesignCZ/phpqa/builds/757068989) - webhooks and app disabled via github settings - init dummy github actions (https://github.com/actions/starter-workflows/blob/main/ci/php.yml) --- .dockerignore | 1 - .gitattributes | 2 +- .github/workflows/php.yml | 71 +++++++++++++++++++++++++++++ .phpqa.yml | 2 +- CHANGELOG.md | 2 +- README.md | 3 +- bin/ci.sh | 2 +- tests/.appveyor/.phpqa.yml | 2 +- tests/{.travis => .ci}/.phpqa.yml | 0 tests/{.travis => .ci}/phpcs.xml | 0 tests/{.travis => .ci}/phpstan.neon | 0 tests/{.travis => .ci}/psalm.xml | 0 12 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/php.yml rename tests/{.travis => .ci}/.phpqa.yml (100%) rename tests/{.travis => .ci}/phpcs.xml (100%) rename tests/{.travis => .ci}/phpstan.neon (100%) rename tests/{.travis => .ci}/psalm.xml (100%) diff --git a/.dockerignore b/.dockerignore index 828ee2de..a053b783 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,7 +10,6 @@ tests vendor *-phpqa.* .php_cs* -.travis.yml docker-compose.yml phpunit.xml auth.json diff --git a/.gitattributes b/.gitattributes index d50e001c..2f15da47 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,5 +4,5 @@ /.dockerignore export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore +/.github export-ignore /phpunit.xml export-ignore \ No newline at end of file diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 00000000..c47e0d3a --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,71 @@ +name: PHPQA CI + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Debug + run: pwd && ls -lAh + +# DEPRECATED TRAVIS +#sudo: required +#dist: trusty +#language: php +#services: +# - docker +#matrix: +# include: +# - php: 5.4 +# - php: 5.5 +# - php: 5.6 +# - php: 7.0 +# - php: 7.1 +# - php: 7.2 +# - php: 7.3 +# - php: 7.4 +#install: +# - if [ -n "$GITHUB_OAUTH_TOKEN" ]; then composer config -g github-oauth.github.com ${GITHUB_OAUTH_TOKEN}; fi; +# - composer install --no-interaction +# - | +# # test latest tool versions (needs symfony3 components) +# if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then +# # 1) delete sebastian dependency hell +# composer remove phpunit/phpunit --dev --no-interaction && composer remove sebastian/phpcpd --no-interaction; +# # 2) update tools +# composer update; +# # 3) reinstall sebastian... +# composer require phpunit/phpunit:~7.0 --dev && composer require sebastian/phpcpd; +# # 4) install suggested tools +# bin/suggested-tools.sh install; +# # 5) hotfix CI issues - see commit 48dd427 +# composer require sensiolabs/security-checker:~5; +# fi +# # test installing suggested tools like docker image +# if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then +# bin/suggested-tools.sh install --prefer-dist; +# fi +#script: +# - vendor/phpunit/phpunit/phpunit +# - ./phpqa tools +# - bin/ci.sh +# - ls -lAh build +#deploy: +# - provider: script +# script: .docker/build-image +# skip_cleanup: false +# on: +# all_branches: true +# php: 7.2 +## http://blog.wyrihaximus.net/2015/07/composer-cache-on-travis/ +#cache: +# directories: +# - vendor +# - $HOME/.composer/cache +# diff --git a/.phpqa.yml b/.phpqa.yml index 3beacd2c..cbe23288 100644 --- a/.phpqa.yml +++ b/.phpqa.yml @@ -64,7 +64,7 @@ phpmetrics: phpstan: level: 0 # https://github.com/phpstan/phpstan#configuration - # standard: tests/.travis/phpstan.neon + # standard: tests/.ci/phpstan.neon phpunit: # binary: vendor/bin/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index f7509a5c..816ed9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -181,7 +181,7 @@ ## v1.11.0 * [#54](https://github.com/EdgedesignCZ/phpqa/pull/54) Advanced phpcs configuration - * define [custom reports](https://github.com/EdgedesignCZ/phpqa/blob/master/tests/.travis/.phpqa.yml#L2) in `phpcs.reports` + * define [custom reports](https://github.com/EdgedesignCZ/phpqa/blob/master/tests/.ci/.phpqa.yml#L2) in `phpcs.reports` * [#53](https://github.com/EdgedesignCZ/phpqa/issues/53) - allow ignoring warnings in `phpcs.ignoreWarnings` ## v1.10.0 diff --git a/README.md b/README.md index b9e2af6a..5c3214bc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Analyze PHP code with one command. [![License](https://poser.pugx.org/edgedesign/phpqa/license)](https://packagist.org/packages/edgedesign/phpqa) [![Latest Stable Version](https://poser.pugx.org/edgedesign/phpqa/v/stable)](/CHANGELOG.md) [![Total Downloads](https://poser.pugx.org/edgedesign/phpqa/downloads)](https://packagist.org/packages/edgedesign/phpqa) -[![Build Status](https://travis-ci.org/EdgedesignCZ/phpqa.svg)](https://travis-ci.org/EdgedesignCZ/phpqa) [![Windows status](https://ci.appveyor.com/api/projects/status/t9f05uk4cjcg294o?svg=true&passingText=Windows)](https://ci.appveyor.com/project/zdenekdrahos/phpqa) ## Requirements @@ -255,7 +254,7 @@ Tool | Settings | Default Value | Your value [pdepend.coverageReport](https://github.com/EdgedesignCZ/phpqa/pull/124) | Load Clover style CodeCoverage report | `null` | Path to report produced by PHPUnit's `--coverage-clover` option [phpmd.standard](http://phpmd.org/documentation/creating-a-ruleset.html) | Ruleset | [Edgedesign's standard](/app/phpmd.xml) | Path to ruleset. To specify [multiple rule sets](https://phpmd.org/documentation/index.html#using-multiple-rule-sets), you can use an array [phpcpd](https://github.com/sebastianbergmann/phpcpd/blob/de9056615da6c1230f3294384055fa7d722c38fa/src/CLI/Command.php#L136) | Minimum number of lines/tokens for copy-paste detection | 5 lines, 70 tokens | -[phpstan](https://github.com/phpstan/phpstan#configuration) | Level, config file | Level 0, `%currentWorkingDirectory%/phpstan.neon` | Take a look at [phpqa config in tests/.travis](/tests/.travis/) | +[phpstan](https://github.com/phpstan/phpstan#configuration) | Level, config file | Level 0, `%currentWorkingDirectory%/phpstan.neon` | Take a look at [phpqa config in tests/.ci](/tests/.ci/) | [phpunit.binary](https://github.com/EdgedesignCZ/phpqa/blob/4947416/.phpqa.yml#L40) | Phpunit binary | phpqa's phpunit | Path to phpunit executable in your project, typically [`vendor/bin/phpunit`](https://gitlab.com/costlocker/integrations/blob/master/basecamp/backend/.phpqa.yml#L2) | [phpunit.config](https://phpunit.de/manual/current/en/organizing-tests.html#organizing-tests.xml-configuration) | PHPUnit configuration, `analyzedDirs` and `ignoredDirs` are not used, you have to specify test suites in XML file | `null` | Path to `phpunit.xml` file [phpunit.reports](https://phpunit.de/manual/current/en/textui.html) | Report types | no report | List of reports and formats, corresponds with CLI option, e.g. `--log-junit` is `log: [junit]` in `.phpqa.yml` | diff --git a/bin/ci.sh b/bin/ci.sh index bd5f2eeb..0b822da1 100755 --- a/bin/ci.sh +++ b/bin/ci.sh @@ -1,3 +1,3 @@ #!/bin/sh -./phpqa --config tests/.travis +./phpqa --config tests/.ci diff --git a/tests/.appveyor/.phpqa.yml b/tests/.appveyor/.phpqa.yml index 8791b303..eb7d6e15 100644 --- a/tests/.appveyor/.phpqa.yml +++ b/tests/.appveyor/.phpqa.yml @@ -2,7 +2,7 @@ phpqa: tools: phpmetrics,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpcpd:0,phpstan,phpunit:0,psalm,security-checker,parallel-lint phpcs: - standard: ../.travis/phpcs.xml + standard: ../.ci/phpcs.xml ignoreWarnings: false reports: file: diff --git a/tests/.travis/.phpqa.yml b/tests/.ci/.phpqa.yml similarity index 100% rename from tests/.travis/.phpqa.yml rename to tests/.ci/.phpqa.yml diff --git a/tests/.travis/phpcs.xml b/tests/.ci/phpcs.xml similarity index 100% rename from tests/.travis/phpcs.xml rename to tests/.ci/phpcs.xml diff --git a/tests/.travis/phpstan.neon b/tests/.ci/phpstan.neon similarity index 100% rename from tests/.travis/phpstan.neon rename to tests/.ci/phpstan.neon diff --git a/tests/.travis/psalm.xml b/tests/.ci/psalm.xml similarity index 100% rename from tests/.travis/psalm.xml rename to tests/.ci/psalm.xml