diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 00000000..8ae7ef7a --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,63 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +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 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 }} 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 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