diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..fa8d80c --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,32 @@ +name: run-tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + run-tests: + runs-on: ubuntu-latest + + steps: + - name: Update apt + run: sudo apt-get update --fix-missing + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, iconv, imagick, intl + coverage: none + env: + COMPOSER_AUTH_JSON: ${{ secrets.COMPOSER_AUTH_JSON }} + + - name: Install dependencies + run: composer install --prefer-dist --no-interaction + + - name: Execute tests + run: composer test \ No newline at end of file diff --git a/composer.json b/composer.json index a379634..802340c 100644 --- a/composer.json +++ b/composer.json @@ -47,5 +47,10 @@ "Elasticsearch": "AviationCode\\Elasticsearch\\Facades\\Elasticsearch" } } + }, + "scripts": { + "test": [ + "vendor/bin/phpunit" + ] } }