-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31c8d0e
commit 52394bd
Showing
2 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,60 @@ | ||
name: tests | ||
|
||
on: [ push, pull_request ] | ||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php: [8.0, 8.1, 8.2, 8.3] | ||
laravel: ['9.*', '10.*', '11.*'] | ||
dependency-version: [prefer-lowest, prefer-stable] | ||
exclude: | ||
- laravel: 9.* | ||
php: 8.2 | ||
- laravel: 9.* | ||
php: 8.3 | ||
- laravel: 10.* | ||
php: 8.0 | ||
- laravel: 11.* | ||
php: 8.0 | ||
- laravel: 11.* | ||
php: 8.1 | ||
include: | ||
- laravel: 9.* | ||
testbench: 7.* | ||
- laravel: 10.* | ||
testbench: 8.* | ||
- laravel: 11.* | ||
testbench: 9.* | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} | ||
|
||
steps: | ||
- name: Make chown | ||
run: sudo chown -R $USER:$USER ${{ github.workspace }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker compose up | ||
run: docker-compose up -d | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@v2 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
path: ~/.composer/cache/files | ||
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} | ||
|
||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
- name: Run test suite | ||
run: vendor/bin/phpunit --coverage-clover coverage.xml | ||
# - uses: codecov/codecov-action@v1 | ||
# with: | ||
# file: ./coverage.xml | ||
# flags: unittests | ||
# fail_ci_if_error: true | ||
run: | | ||
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | ||
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | ||
- name: Execute tests | ||
run: vendor/bin/phpunit --testdox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,5 +61,5 @@ | |
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable" : true | ||
"prefer-stable": true | ||
} |