diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml new file mode 100644 index 0000000..9028f32 --- /dev/null +++ b/.github/workflows/continuous_integration.yml @@ -0,0 +1,56 @@ +name: "Continuous Integration" + +on: + pull_request: ~ + push: + branches: + - master + +jobs: + + continuous-integration: + name: "Continuous Integration" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + install-args: ['', '--prefer-lowest'] + php-version: ['7.4', '8.0', '8.1'] + fail-fast: false + + steps: + # Cancel previous runs of the same branch + - name: cancel + uses: styfle/cancel-workflow-action@0.10.0 + with: + access_token: ${{ github.token }} + + - name: "Checkout" + uses: "actions/checkout@v3" + + - name: "Install PHP with extensions" + uses: "shivammathur/setup-php@v2" + with: + coverage: "xdebug" + php-version: "${{ matrix.php-version }}" + tools: composer:v2 + + - name: composer-cache-dir + id: composercache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: composer-cache + uses: actions/cache@v3 + with: + path: ${{ steps.composercache.outputs.dir }} + key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }} + restore-keys: | + composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }} + composer-${{ hashFiles('**/composer.json') }}- + composer- + - name: "Install dependencies with composer" + run: | + composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist + - name: "Run tests with phpunit/phpunit" + run: "vendor/bin/phpunit" \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 39eae8f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - - 8.0 - -env: - matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" -matrix: - exclude: - - php: 7.3 - env: COMPOSER_FLAGS="--prefer-lowest" - -before_script: - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction - -script: -- vendor/bin/phpunit diff --git a/README.md b/README.md index 62a8fc4..f924585 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Latest Stable Version](https://poser.pugx.org/thecodingmachine/graphqlite-laravel/v/stable)](https://packagist.org/packages/thecodingmachine/graphqlite-laravel) [![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/graphqlite-laravel/v/unstable)](https://packagist.org/packages/thecodingmachine/graphqlite-laravel) [![License](https://poser.pugx.org/thecodingmachine/graphqlite-laravel/license)](https://packagist.org/packages/thecodingmachine/graphqlite-laravel) -[![Build Status](https://travis-ci.org/thecodingmachine/graphqlite-laravel.svg?branch=master)](https://travis-ci.org/thecodingmachine/graphqlite-laravel) +[![Build Status](https://github.com/thecodingmachine/graphqlite/workflows/Continuous%20Integration/badge.svg)](https://github.com/thecodingmachine/graphqlite/actions) Laravel GraphQLite bindings