diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..6d89c90 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,42 @@ +name: Unit Tests + +on: + push: + branches: + - master + pull_request: + branches: + - "*" + schedule: + - cron: '0 0 * * *' + +jobs: + php-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + COMPOSER_NO_INTERACTION: 1 + + strategy: + matrix: + php: [8.0, 7.4, 7.3, 7.2, 7.1] + + name: P${{ matrix.php }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer:v2 + + - name: Install dependencies + run: | + composer install -o --quiet + + - name: Execute Unit Tests + run: composer test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d0ba93c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev - -script: phpunit \ No newline at end of file diff --git a/composer.json b/composer.json index 62079e9..30cfde1 100644 --- a/composer.json +++ b/composer.json @@ -41,5 +41,10 @@ "Kalnoy\\Nestedset\\NestedSetServiceProvider" ] } + }, + "scripts": { + "test": [ + "@php ./vendor/bin/phpunit" + ] } }