diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..9fc63f9 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,43 @@ +name: "Unit tests" + +on: [ "pull_request", "push" ] + +jobs: + unit-tests: + name: "Unit tests" + + runs-on: ubuntu-20.04 + + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + dependencies: + - lowest + - highest + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Caching dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}" + + - name: "Installing dependencies lowest" + run: "composer update --no-interaction --no-progress --prefer-lowest --prefer-stable" + if: "matrix.dependencies == 'lowest'" + + - name: "Installing dependencies highest" + run: "composer update --no-interaction --no-progress" + if: matrix.dependencies != 'lowest' + + - name: "Unit tests" + run: "vendor/bin/phpunit" diff --git a/.gitignore b/.gitignore index baf67f2..ac494a9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.phar phpunit.xml composer.lock +.phpunit.result.cache diff --git a/.scrutinizer.yml b/.scrutinizer.yml index ec27109..3266789 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,6 +21,9 @@ checks: fix_doc_comments: true build: + environment: + variables: + XDEBUG_MODE: coverage tests: override: - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4dbc196..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - nightly - -env: - - DEPS=lowest - - DEPS=latest - -before_script: - - if [[ $DEPS == 'lowest' ]]; then composer update --prefer-stable --no-interaction --prefer-lowest ; fi - - if [[ $DEPS == 'latest' ]]; then composer update --prefer-stable --no-interaction ; fi - -script: - - vendor/bin/phpunit diff --git a/composer.json b/composer.json index de9c0a6..2c1b8e7 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ "require-dev": { "league/tactician-doctrine": "^1.0", "phpunit/phpunit": "^7.5.20 || ^9.3.8", - "doctrine/orm": "^2.5" + "doctrine/orm": "^2.5", + "squizlabs/php_codesniffer": "^3.6" }, "keywords": [ "laminas framework",