ci: add Makefile targets for running tests locally with act #31
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| tests: | |
| name: PHP ${{ matrix.php }} with Laravel ${{ matrix.laravel }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - php: '8.2' | |
| laravel: '11' | |
| testbench: '^9' | |
| - php: '8.2' | |
| laravel: '12' | |
| testbench: '^10' | |
| - php: '8.3' | |
| laravel: '12' | |
| testbench: '^10' | |
| - php: '8.3' | |
| laravel: '13' | |
| testbench: '^11' | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Allow Composer advisory-block bypass for compatibility matrix | |
| run: | | |
| mkdir -p "$HOME/.composer" | |
| cat > "$HOME/.composer/config.json" <<'JSON' | |
| { | |
| "config": { | |
| "policy": { | |
| "advisories": { | |
| "block": false | |
| } | |
| } | |
| } | |
| } | |
| JSON | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Setup Problem Matchers | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Select Laravel ${{ matrix.laravel }} | |
| uses: nick-invision/retry@v2 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 5 | |
| command: composer require "laravel/framework:${{ matrix.laravel }}.*" "orchestra/testbench:${{ matrix.testbench }}" --dev --no-update --no-interaction -W | |
| - name: Install dependencies | |
| uses: nick-invision/retry@v2 | |
| with: | |
| timeout_minutes: 5 | |
| max_attempts: 5 | |
| command: composer update --no-interaction --no-progress -W | |
| - name: Run tests for Laravel ${{ matrix.laravel }} | |
| run: vendor/bin/phpunit |