From fb72e814e291b4331c65e6e69036d73127b5131f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 18:53:28 +0100 Subject: [PATCH 01/15] Disable composer runtime platform check --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 6013b89..8b15574 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,9 @@ "NepadaTests\\": "tests/" } }, + "config": { + "platform-check": false + }, "extra": { "branch-alias": { "dev-master": "1.0-dev" From ea026b80e058771e49653184d00eeb6e9aa49779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 18:57:27 +0100 Subject: [PATCH 02/15] Update php.ini for tests --- tests/php.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/php.ini b/tests/php.ini index e69de29..720e7bc 100644 --- a/tests/php.ini +++ b/tests/php.ini @@ -0,0 +1,3 @@ +[php] +extension=json.so +extension=tokenizer.so From 5e6142ed3c5cd98c683170c7dda0be8db6635027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 17:41:50 +0100 Subject: [PATCH 03/15] Migrate CI to Github Actions --- .github/workflows/tests.yaml | 77 ++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..a9b79eb --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,77 @@ +name: CI + +on: [ push, pull_request ] + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: + - 7.4 + composer_args: + - '' + - '--prefer-stable' + - '--prefer-stable --prefer-lowest' + name: PHP ${{ matrix.php }} ${{ matrix.composer_args }} + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + - name: Build + env: + COMPOSER_ARGS: ${{ matrix.composer_args }} + run: composer update --no-interaction --no-progress --prefer-dist $COMPOSER_ARGS + - name: Lint + run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests + - name: Tests + run: vendor/bin/tester -c tests/php.ini -s tests + - name: PHPStan + run: | + vendor/bin/phpstan analyse + vendor/bin/phpstan analyse -c phpstan.tests.neon.dist + - if: failure() + uses: actions/upload-artifact@v2 + with: + name: output + path: tests/**/output + + code_style: + runs-on: ubuntu-latest + needs: [ tests ] + name: Code Style + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + - name: Build + run: composer update --no-interaction --no-progress --prefer-dist --prefer-stable + - name: Check Code Style + run: vendor/bin/phpcs + + code_coverage: + runs-on: ubuntu-latest + needs: [ tests ] + continue-on-error: true + name: Code Coverage + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + - run: composer global require php-coveralls/php-coveralls + - name: Build + run: composer update --no-interaction --no-progress --prefer-dist --prefer-stable + - name: Calculate coverage + run: vendor/bin/tester -c tests/php.ini -p phpdbg tests --coverage coverage.xml --coverage-src src + - name: Upload Coverage Report + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: php-coveralls --verbose --config tests/coveralls.yml + From cbd0fef83ae6bc9057487e6fb766d9232cf2f0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 17:48:19 +0100 Subject: [PATCH 04/15] Remove travis config --- .travis.yml | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6840ff0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php -php: - - 7.4 - -env: - - COMPOSER_ARGS="" - - COMPOSER_ARGS="--prefer-stable" - - COMPOSER_ARGS="--prefer-stable --prefer-lowest" - -jobs: - include: - - stage: Code Standard Checker - php: 7.4 - script: - - vendor/bin/phpcs - - stage: Code Coverage - php: 7.4 - script: - - vendor/bin/tester -p phpdbg tests -s --coverage ./coverage.xml --coverage-src ./src - after_script: - - travis_retry wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar - - php php-coveralls.phar --verbose --config tests/coveralls.yml - allow_failures: - - stage: Code Coverage - -install: - - travis_retry composer update --no-interaction --prefer-dist $COMPOSER_ARGS - -script: - - vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests - - vendor/bin/tester -s -p php -c tests/php.ini tests - - vendor/bin/phpstan analyse - - vendor/bin/phpstan analyse -c phpstan.tests.neon.dist - -after_failure: - - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done - -sudo: false - -cache: - directories: - - $HOME/.composer/cache From dc9e0c8822cc486ffcc890401fbe185fad220252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 20:04:20 +0100 Subject: [PATCH 05/15] schedule --- .github/workflows/tests.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a9b79eb..e8a05d7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,6 +1,10 @@ name: CI -on: [ push, pull_request ] +on: + push: + pull_request: + schedule: + - cron: '10 20 * * 0' jobs: tests: From 838b229b4185a83abb1fbd24c68a01869c60aa3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 20:06:37 +0100 Subject: [PATCH 06/15] sched --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e8a05d7..415db76 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -4,7 +4,7 @@ on: push: pull_request: schedule: - - cron: '10 20 * * 0' + - cron: '0 10 * * 5' jobs: tests: From b01226f15048b0852a5a21ab9e6d12c145b5367a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:37:11 +0100 Subject: [PATCH 07/15] cache --- .github/workflows/tests.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 415db76..90d70f1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,6 +25,14 @@ jobs: with: php-version: ${{ matrix.php }} coverage: none + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.composer/cache + key: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}-${{ matrix.composer_args }}-${{ github.run_number }} + restore-keys: | + composer-${{ hashFiles('composer.json') }} + composer- - name: Build env: COMPOSER_ARGS: ${{ matrix.composer_args }} From 10571c7ca4ceb45b4fd07749c7d2122c1d30ab48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:40:08 +0100 Subject: [PATCH 08/15] typo --- .github/workflows/tests.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 90d70f1..728025c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,13 +26,13 @@ jobs: php-version: ${{ matrix.php }} coverage: none - name: Cache - uses: actions/cache@v2 - with: - path: ~/.composer/cache - key: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}-${{ matrix.composer_args }}-${{ github.run_number }} - restore-keys: | - composer-${{ hashFiles('composer.json') }} - composer- + uses: actions/cache@v2 + with: + path: ~/.composer/cache + key: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}-${{ matrix.composer_args }}-${{ github.run_number }} + restore-keys: | + composer-${{ hashFiles('composer.json') }} + composer- - name: Build env: COMPOSER_ARGS: ${{ matrix.composer_args }} From b34f65662cb681055dc35d8fdb592039ffa10c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:40:24 +0100 Subject: [PATCH 09/15] test --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 728025c..bfee44c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,6 +31,7 @@ jobs: path: ~/.composer/cache key: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}-${{ matrix.composer_args }}-${{ github.run_number }} restore-keys: | + composer-${{ hashFiles('composer.json') }}-${{ matrix.php }} composer-${{ hashFiles('composer.json') }} composer- - name: Build From 31a9e5ea89cbd1889f42be52007fc08057cf6eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:44:57 +0100 Subject: [PATCH 10/15] ls --- .github/workflows/tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bfee44c..2d2ce0a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -34,6 +34,9 @@ jobs: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }} composer-${{ hashFiles('composer.json') }} composer- + - run: | + ls -alh ~/.composer || true + ls -alh ~/.composer/cache || true - name: Build env: COMPOSER_ARGS: ${{ matrix.composer_args }} From 1767183799767a01d12c95b591d7bd4980889dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:46:23 +0100 Subject: [PATCH 11/15] test --- .github/workflows/tests.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2d2ce0a..55c1536 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -34,13 +34,14 @@ jobs: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }} composer-${{ hashFiles('composer.json') }} composer- - - run: | - ls -alh ~/.composer || true - ls -alh ~/.composer/cache || true - name: Build env: COMPOSER_ARGS: ${{ matrix.composer_args }} run: composer update --no-interaction --no-progress --prefer-dist $COMPOSER_ARGS + - run: | + ls -alh ~/.composer || true + ls -alh ~/.composer/cache || true + env | grep COMPOSER - name: Lint run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests - name: Tests From 20505977febd5e252e40bf95d430748165326b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:47:43 +0100 Subject: [PATCH 12/15] test --- .github/workflows/tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 55c1536..ea6715d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,7 +40,6 @@ jobs: run: composer update --no-interaction --no-progress --prefer-dist $COMPOSER_ARGS - run: | ls -alh ~/.composer || true - ls -alh ~/.composer/cache || true env | grep COMPOSER - name: Lint run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests From 086e2e9f4b73db1a63c2dc903226ba967d722de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:48:42 +0100 Subject: [PATCH 13/15] env --- .github/workflows/tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ea6715d..de5ae2b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -41,6 +41,8 @@ jobs: - run: | ls -alh ~/.composer || true env | grep COMPOSER + env | grep XDG + ls -alh ~ - name: Lint run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests - name: Tests From 2628b1a7641f18241c9eb23829e1e5d7e1a9945f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:50:06 +0100 Subject: [PATCH 14/15] test --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index de5ae2b..68252ab 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,9 +40,9 @@ jobs: run: composer update --no-interaction --no-progress --prefer-dist $COMPOSER_ARGS - run: | ls -alh ~/.composer || true - env | grep COMPOSER - env | grep XDG ls -alh ~ + env | grep COMPOSER || true + env | grep XDG || true - name: Lint run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests - name: Tests From adebd7f06088d27f7456d5647dc2283c50818904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Sun, 1 Nov 2020 21:54:30 +0100 Subject: [PATCH 15/15] test --- .github/workflows/tests.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 68252ab..0a4997f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,9 +40,7 @@ jobs: run: composer update --no-interaction --no-progress --prefer-dist $COMPOSER_ARGS - run: | ls -alh ~/.composer || true - ls -alh ~ - env | grep COMPOSER || true - env | grep XDG || true + ls -alh ~/.cache - name: Lint run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests - name: Tests