Initial vite build #143
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: 'ci / Laravel' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- 6.x | |
pull_request: | |
concurrency: | |
group: laravel-ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pint: | |
name: 'Code Quality / Pint' | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.4' | |
tools: composer:v2, laravel/pint | |
extensions: json, dom, curl, libxml, mbstring | |
coverage: none | |
- name: Run Pint | |
run: pint --parallel --test --verbose | |
phpstan: | |
name: 'Code Quality / Phpstan' | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.4' | |
coverage: none | |
- name: Set version | |
run: composer config version "6.x-dev" | |
- name: Install composer dependencies | |
uses: ramsey/composer-install@v3 | |
- name: Run PHPStan | |
run: ./vendor/bin/phpstan --error-format=github | |
tests: | |
needs: [pint, phpstan] | |
name: Tests / PHP ${{ matrix.php }} on ${{ matrix.db }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.4] | |
db: [mysql, pgsql] | |
services: | |
# Install Postgres | |
pgsql: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: root | |
POSTGRES_PASSWORD: mysecretpassword | |
POSTGRES_DB: craft_test | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until Postgres has started | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 | |
# Install MySQL | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: mysecretpassword | |
MYSQL_DATABASE: craft_test | |
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password | |
# Set health checks to wait until mysql has started | |
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
ports: | |
- 3306:3306 | |
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, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: none | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COMPOSER_AUTH_JSON: | | |
{ | |
"http-basic": { | |
"repo.packagist.com": { | |
"username": "${{ secrets.packagist_username }}", | |
"password": "${{ secrets.packagist_token }}" | |
} | |
} | |
} | |
- name: Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Copy tests .env | |
run: | | |
cp ./tests/.env.example.${{ matrix.db }} ./tests/.env | |
sed -i 's/DB_PASSWORD=/DB_PASSWORD=mysecretpassword/' tests/.env | |
- name: Set version | |
run: composer config version "6.x-dev" | |
- name: Install dependencies | |
uses: ramsey/composer-install@v3 | |
- name: Execute CMS tests | |
run: vendor/bin/pest | |
- name: Set version | |
run: composer config version "6.x-dev" | |
working-directory: yii2-adapter | |
- name: Install yii2-adapter dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
working-directory: yii2-adapter | |
- name: Execute Yii2 Adapter tests | |
run: vendor/bin/pest --ci --configuration ./yii2-adapter/phpunit.xml.dist --test-directory ./yii2-adapter/tests-laravel |