diff --git a/.github/workflows/tests.php.unit.yml b/.github/workflows/tests.php.unit.yml new file mode 100644 index 0000000..7ba0ab7 --- /dev/null +++ b/.github/workflows/tests.php.unit.yml @@ -0,0 +1,34 @@ +name: PHP Unit Tests + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - '5.5' + - '5.6' + - '7.0' + include: + - php-version: '7.0' + allow_failure: true + continue-on-error: ${{ matrix.allow_failure || false }} + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + coverage: xdebug + extensions: gd, json, mbstring + php-version: ${{ matrix.php-version }} + - run: composer install --no-interaction --prefer-dist + - run: vendor/bin/phpunit + - uses: codecov/codecov-action@v5 + if: success() + with: + token: ${{ secrets.CODECOV_TOKEN }} + - uses: coverallsapp/github-action@v2 + if: success() diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 90567ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - - 7.0 - - hhvm - -sudo: false - -matrix: - allow_failures: - - php: 7.0 - - php: hhvm - -install: - - composer install - -script: - - vendor/bin/phpunit --configuration build/phpunit.xml && cat build/testdox.txt build/coverage.txt - -after_success: - - bash <(curl -s https://codecov.io/bash) - - php vendor/bin/coveralls -v diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f1a4dd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +ARG PHP_VERSION +FROM php:${PHP_VERSION} + +RUN apk add --no-cache \ + libpng \ + libpng-dev \ + ${PHPIZE_DEPS} \ + && docker-php-ext-install gd \ + && pecl install xdebug-2.5.5 \ + && docker-php-ext-enable xdebug \ + && apk del libpng-dev ${PHPIZE_DEPS} + +COPY --from=composer /usr/bin/composer /usr/bin/composer + +ENV XDEBUG_MODE coverage + +WORKDIR /code + +CMD ["php", "./vendor/bin/phpunit"] diff --git a/composer.json b/composer.json index 5257566..e0de276 100644 --- a/composer.json +++ b/composer.json @@ -29,8 +29,7 @@ "josegonzalez/dotenv": "~2.0", "phpunit/phpunit" : "~4.8", "satooshi/php-coveralls": "~0.6", - "scrutinizer/ocular": "~1.1", - "whatthejeff/nyancat-phpunit-resultprinter": "~1.2" + "scrutinizer/ocular": "~1.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f04bd2b..a6e85d0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ - + tests/unit-tests