Merge branch 'feat/new-starter-kits' #2576
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: tests | |
on: | |
push: | |
branches: | |
- main | |
- '*.x' | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [ 8.2, 8.3 ] | |
laravel: [ 11, 12 ] | |
name: Run Tests – P${{ matrix.php }} - L${{ matrix.laravel }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pdo, pdo_sqlite | |
tools: composer:v2 | |
coverage: none | |
- name: Install dependencies | |
run: | | |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --no-update | |
composer update --prefer-dist --no-interaction --no-progress | |
- name: Execute tests | |
run: ./vendor/bin/pest | |
test-starter-kits: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ 8.2, 8.3, 8.4 ] | |
laravel: [ 12 ] | |
stack: [ react, vue, livewire ] | |
tester: [ phpunit, pest ] | |
stability: [ prefer-lowest, prefer-stable ] | |
name: Test Laravel Starter Kit Integrations - P${{ matrix.php }} – L${{ matrix.laravel }} (${{ matrix.stack }}, ${{ matrix.tester }}) - ${{ matrix.stability }} | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pdo, pdo_sqlite | |
ini-values: error_reporting=E_ALL | |
tools: composer:v2 | |
coverage: none | |
- name: Setup Project | |
run: | | |
composer global require laravel/installer | |
export PATH="$HOME/.composer/vendor/bin:$PATH" | |
laravel new laravel-${{ matrix.stack }}-starter-kit --${{ matrix.stack }} --${{ matrix.tester }} | |
cd laravel-${{ matrix.stack }}-starter-kit | |
composer require joelbutcher/socialstream:@dev --no-interaction --no-update | |
composer config repositories.socialstream '{"type": "path", "url": "socialstream"}' --file composer.json | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
path: 'socialstream' | |
- name: Install Socialstream | |
run: | | |
composer update "joelbutcher/socialstream" -W --prefer-dist --no-interaction | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
php artisan socialstream:install ${{ matrix.stack }} \ | |
${{ matrix.tester == 'pest' && '--pest' || '' }} \ | |
- name: Install dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
- name: Install NPM dependencies | |
run: npm i | |
- name: Compile assets | |
run: npm run build | |
- name: Execute tests | |
run: ./vendor/bin/${{ matrix.tester }} | |
env: | |
DB_CONNECTION: sqlite | |
DB_DATABASE: ":memory:" |