Demo #5
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: Demo | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: "The branch, tag or SHA to checkout." | |
required: false | |
default: "" | |
jobs: | |
build: | |
name: P${{ matrix.php-version }} - L${{ matrix.laravel-version }} - ${{ matrix.os }} | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: laravel | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['8.1', '8.2', '8.3'] | |
laravel-version: [10, 11] | |
os: [ubuntu-latest] | |
exclude: | |
- laravel-version: 11.* | |
php-version: 8.1 | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
- name: Determine composer cache directory | |
id: determine-composer-cache-directory | |
run: 'echo "::set-output name=directory::$(composer config cache-dir)"' | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.determine-composer-cache-directory.outputs.directory }} | |
key: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-prefer-stable-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-prefer-stable-composer- | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd | |
coverage: none | |
tools: composer:v2 | |
ini-values: "memory_limit=-1" | |
- name: Setup problem matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Create a Laravel app | |
run: composer create-project --prefer-dist laravel/laravel:${{ matrix.laravel-version }}.* /home/runner/work/blueprint/laravel${{ matrix.laravel-version }}-example | |
- name: Link local repository | |
run: 'composer config repositories.local "{\"type\": \"path\", \"url\": \"/home/runner/work/blueprint/blueprint\"}" --file /home/runner/work/blueprint/laravel${{ matrix.laravel-version }}-example/composer.json' | |
- name: Install Blueprint & laravel-test-assertions | |
working-directory: /home/runner/work/blueprint/laravel${{ matrix.laravel-version }}-example | |
run: composer require --dev laravel-shift/blueprint @dev jasonmccreary/laravel-test-assertions | |
- name: Run migrate:refresh | |
working-directory: /home/runner/work/blueprint/laravel${{ matrix.laravel-version }}-example | |
run: php artisan migrate:refresh --force | |
- name: Run blueprint:build | |
working-directory: /home/runner/work/blueprint/laravel${{ matrix.laravel-version }}-example | |
run: php artisan blueprint:build /home/runner/work/blueprint/blueprint/tests/fixtures/drafts/readme-example.yaml |