|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: '0 4 * * 1' |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + php: [7.1, 7.2, 7.3, 7.4] |
| 17 | + laravel: [5.5, 5.6, 5.7, 5.8, 6] |
| 18 | + exclude: |
| 19 | + - php: 7.1 |
| 20 | + laravel: 6 |
| 21 | + |
| 22 | + name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v2 |
| 26 | + - name: Pull Docker Image |
| 27 | + run: docker pull registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} |
| 28 | + - name: Select Laravel 5.5 |
| 29 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint composer registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} require "laravel/framework:5.5.*" "phpunit/phpunit:^6.5" --no-update -n |
| 30 | + if: "matrix.laravel == 5.5" |
| 31 | + - name: Select Laravel 5.6 |
| 32 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint composer registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} require "laravel/framework:5.6.*" "phpunit/phpunit:^7.5" --no-update -n |
| 33 | + if: "matrix.laravel == 5.6" |
| 34 | + - name: Select Laravel 5.7 |
| 35 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint composer registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} require "laravel/framework:5.7.*" "phpunit/phpunit:^7.5" --no-update -n |
| 36 | + if: "matrix.laravel == 5.7" |
| 37 | + - name: Select Laravel 5.8 |
| 38 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint composer registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} require "laravel/framework:5.8.*" "phpunit/phpunit:^7.5|^8.5" --no-update -n |
| 39 | + if: "matrix.laravel == 5.8" |
| 40 | + - name: Select Laravel 6 |
| 41 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint composer registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} require "laravel/framework:6.*" "phpunit/phpunit:^8.5|^9.0" --no-update -n |
| 42 | + if: "matrix.laravel == 6" |
| 43 | + - name: Run Composer |
| 44 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint composer registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} install --prefer-dist -n -o |
| 45 | + - name: Run PHPUnit |
| 46 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} --coverage-clover build/logs/clover.xml |
| 47 | + - name: Upload Coverage |
| 48 | + run: docker run --rm -w /data -v ${{ github.workspace }}:/data --entrypoint ocular registry.gitlab.com/grahamcampbell/php:${{ matrix.php }} code-coverage:upload --format=php-clover build/logs/clover.xml |
0 commit comments