Merge pull request #1099 from salehhashemi1992/refactor/switch-to-match #1409
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
name: Integration tests | |
on: | |
pull_request: | |
push: | |
schedule: | |
# Run Monday morning at 3 o'clock | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
- cron: 0 3 * * 1 | |
workflow_dispatch: | |
jobs: | |
supported-versions-matrix: | |
name: Supported Versions Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.supported-versions-matrix.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: supported-versions-matrix | |
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 | |
integration: | |
needs: | |
- supported-versions-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} | |
laravel: [^9.0, ^10.0] | |
exclude: | |
- php: 8.0 | |
laravel: ^10.0 | |
name: P=${{ matrix.php }} L=${{ matrix.laravel }} | |
runs-on: ubuntu-latest | |
env: | |
COMPOSER_NO_INTERACTION: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
# Due to version incompatibility with older Laravels we test, we remove it | |
- run: composer remove --dev nunomaduro/larastan --no-update | |
- run: composer remove --dev friendsofphp/php-cs-fixer --no-update | |
- run: composer require illuminate/contracts:${{ matrix.laravel }} --no-update | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- run: composer install --prefer-dist | |
- run: tests/integration-laravel.sh ${{ matrix.laravel }} |