From 3773a3fc6b0d794a214009da22f75c6775893cc9 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 02:15:51 +0200 Subject: [PATCH 01/10] Create Tests.yml --- .github/Tests.yml | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/Tests.yml diff --git a/.github/Tests.yml b/.github/Tests.yml new file mode 100644 index 00000000..13dd6800 --- /dev/null +++ b/.github/Tests.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + push: + +jobs: + CI: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + env: + PHP_VERSION: ${{ matrix.php }} + name: PHP ${{ matrix.php }} + steps: + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: bz2,xml,curl + env: + runner: ubuntu-22.04 + + - name: Checkout + uses: actions/checkout@v2 + + - name: Validate composer.json + run: composer validate + + - name: Cache composer files + uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Install dependencies using composer + run: composer install --prefer-dist --no-interaction + + - name: PHP CodeStyle + run: | + mkdir -p build/logs + vendor/bin/phpcs src tests --extensions=php --ignore=bootstrap --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml -v + vendor/bin/phpmd src,tests xml build/config/phpmd.xml + + - name: Run PHPUnit + run: vendor/bin/phpunit -c phpunit.xml --verbose + + - name: Upload coverage to Coveralls + run: | + php vendor/bin/php-coveralls -v + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml From a514c60fa258ee496ed1f34f36d7247f0310be11 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 03:42:52 +0200 Subject: [PATCH 02/10] Rename .github/Tests.yml to .github/workflows/Tests.yml --- .github/{ => workflows}/Tests.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/Tests.yml (100%) diff --git a/.github/Tests.yml b/.github/workflows/Tests.yml similarity index 100% rename from .github/Tests.yml rename to .github/workflows/Tests.yml From 092723ccdf5ac3c1dbc146044d392a824d4a4a10 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:00:55 +0200 Subject: [PATCH 03/10] Update Tests.yml only run on push master (duplicate run for PR) --- .github/workflows/Tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 13dd6800..c2d63fba 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -3,6 +3,8 @@ name: CI on: pull_request: push: + branches: + - master jobs: CI: From 86be19902581e8e3d81b108cec5e452696be954a Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:11:27 +0200 Subject: [PATCH 04/10] Update Tests.yml --- .github/workflows/Tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index c2d63fba..68dbf95f 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -50,8 +50,7 @@ jobs: - name: Run PHPUnit run: vendor/bin/phpunit -c phpunit.xml --verbose - - name: Upload coverage to Coveralls - run: | - php vendor/bin/php-coveralls -v - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + - name: Upload coverage results to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v From 88899362ef2cca5b630eda66fdd014abd07a1a62 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:14:27 +0200 Subject: [PATCH 05/10] Delete .travis.yml --- .travis.yml | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aca08c14..00000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -env: - global: - - XDEBUG_MODE=coverage - -language: php - -matrix: - include: - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - fast_finish: true - allow_failures: - - php: 7.4 - -before_script: - - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-source - -cache: - directories: - - $HOME/.composer/cache - -script: - - mkdir -p build/logs - - vendor/bin/phpcs src tests --extensions=php --ignore=bootstrap --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml -v - - vendor/bin/phpmd src,tests xml build/config/phpmd.xml - - vendor/bin/phpunit -c phpunit.xml --verbose - -after_script: - - php vendor/bin/php-coveralls -v - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml - -after_success: - - travis_retry php vendor/bin/php-coveralls -v From 942f94a19ecb59ba0686d8d86991728ef26994ec Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:20:07 +0200 Subject: [PATCH 06/10] Update Tests.yml --- .github/workflows/Tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 68dbf95f..f89d34e7 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -50,7 +50,13 @@ jobs: - name: Run PHPUnit run: vendor/bin/phpunit -c phpunit.xml --verbose - - name: Upload coverage results to Coveralls + - name: Upload Coveralls coverage env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: Upload Scrutinizer coverage + uses: sudo-bot/action-scrutinizer@latest + if: github.repository == 'sudo-bot/example-repo' + with: + cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" From 0d9d226e82ac27ccd8f247654bac94fc5e716b97 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:25:56 +0200 Subject: [PATCH 07/10] Update .scrutinizer.yml --- .scrutinizer.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 765ce5b5..aec27578 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -36,6 +36,7 @@ coding_style: tools: external_code_coverage: enabled: true + runs: 6 timeout: 1800 # Timeout in seconds. php_mess_detector: config: @@ -96,4 +97,4 @@ tools: excluded_dirs: [vendor, tests, examples] php_sim: false sensiolabs_security_checker: - enabled: true \ No newline at end of file + enabled: true From 1bcbbf45d70a8c5f328c3268b1a73021fb78280d Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:27:28 +0200 Subject: [PATCH 08/10] Update Tests.yml --- .github/workflows/Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index f89d34e7..e781818a 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -57,6 +57,6 @@ jobs: - name: Upload Scrutinizer coverage uses: sudo-bot/action-scrutinizer@latest - if: github.repository == 'sudo-bot/example-repo' + #if: github.repository == 'Austinb/GameQ' with: cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" From bc538fc7238fede7cc344f4d862e69356b39c297 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 14:31:49 +0200 Subject: [PATCH 09/10] Update Tests.yml --- .github/workflows/Tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index e781818a..b5b9ed8d 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -56,7 +56,6 @@ jobs: run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: Upload Scrutinizer coverage - uses: sudo-bot/action-scrutinizer@latest - #if: github.repository == 'Austinb/GameQ' - with: - cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }} From f32dd0ff19640080902ef6d83152b753f03befb9 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 22 May 2022 15:32:22 +0200 Subject: [PATCH 10/10] Update Tests.yml --- .github/workflows/Tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index b5b9ed8d..8ae7ef7a 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -51,11 +51,13 @@ jobs: run: vendor/bin/phpunit -c phpunit.xml --verbose - name: Upload Coveralls coverage + if: github.repository == 'Austinb/GameQ' env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: Upload Scrutinizer coverage + if: github.repository == 'Austinb/GameQ' run: | wget https://scrutinizer-ci.com/ocular.phar php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}