diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 0000000..adaa359 --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,29 @@ +name: Check & fix styling + +on: [push] + +jobs: + style: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Fix style + uses: docker://oskarstark/php-cs-fixer-ga + with: + args: --config=.php_cs --allow-risky=yes + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v2.3.0 + with: + commit_message: Fix styling + branch: ${{ steps.extract_branch.outputs.branch }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..0438cfb --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,46 @@ +name: Tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest] + php: [7.4] + laravel: [8.*, 7.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 8.* + testbench: 6.* + - laravel: 7.* + testbench: 5.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: | + composer config --global --auth http-basic.repo.packagist.com token ${{ secrets.COMPOSER_TOKEN }} + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + - name: Execute tests + run: vendor/bin/phpunit \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e6056c0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - -env: - matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - vendor/bin/phpunit diff --git a/README.md b/README.md index 8b4250f..aabde41 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # A set of useful Laravel builder macros [![Latest Version on Packagist](https://img.shields.io/packagist/v/signifly/laravel-builder-macros.svg?style=flat-square)](https://packagist.org/packages/signifly/laravel-builder-macros) -[![Build Status](https://img.shields.io/travis/signifly/laravel-builder-macros/master.svg?style=flat-square)](https://travis-ci.org/signifly/laravel-builder-macros) +![Tests](https://github.com/signifly/laravel-janitor/workflows/Tests/badge.svg) [![StyleCI](https://styleci.io/repos/144017418/shield?branch=master)](https://styleci.io/repos/144017418) [![Quality Score](https://img.shields.io/scrutinizer/g/signifly/laravel-builder-macros.svg?style=flat-square)](https://scrutinizer-ci.com/g/signifly/laravel-builder-macros) [![Total Downloads](https://img.shields.io/packagist/dt/signifly/laravel-builder-macros.svg?style=flat-square)](https://packagist.org/packages/signifly/laravel-builder-macros)