ci: prepare sqlite env in verify job; remove GitHub-only workflow
This commit is contained in:
@@ -15,6 +15,12 @@ jobs:
|
|||||||
php -r 'exit(PHP_VERSION_ID >= 80200 ? 0 : 1);'
|
php -r 'exit(PHP_VERSION_ID >= 80200 ? 0 : 1);'
|
||||||
node --version
|
node --version
|
||||||
composer --version
|
composer --version
|
||||||
|
- name: Prepare env (sqlite for package discovery)
|
||||||
|
run: |
|
||||||
|
cp .env.example .env
|
||||||
|
php artisan key:generate --force
|
||||||
|
mkdir -p database
|
||||||
|
touch database/database.sqlite
|
||||||
- name: Install backend dependencies
|
- name: Install backend dependencies
|
||||||
run: |
|
run: |
|
||||||
composer install --no-interaction --prefer-dist
|
composer install --no-interaction --prefer-dist
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, master, dev, ak-local]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
tests:
|
|
||||||
name: PHPUnit (PHP ${{ matrix.php }})
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
php: ['8.2', '8.3']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: ${{ matrix.php }}
|
|
||||||
extensions: mbstring, sqlite, pdo_sqlite, gd, zip, intl, bcmath, redis
|
|
||||||
coverage: none
|
|
||||||
|
|
||||||
- name: Get Composer cache dir
|
|
||||||
id: composer-cache
|
|
||||||
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-composer-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
||||||
|
|
||||||
- name: Prepare env
|
|
||||||
run: |
|
|
||||||
cp .env.example .env
|
|
||||||
php artisan key:generate
|
|
||||||
mkdir -p database
|
|
||||||
touch database/database.sqlite
|
|
||||||
|
|
||||||
- name: Run migrations (sqlite file smoke)
|
|
||||||
env:
|
|
||||||
DB_CONNECTION: sqlite
|
|
||||||
DB_DATABASE: ${{ github.workspace }}/database/database.sqlite
|
|
||||||
APP_ENV: testing
|
|
||||||
ATTACHMENTS_DRIVER: local
|
|
||||||
AI_PROVIDER: stub
|
|
||||||
run: php artisan migrate --force
|
|
||||||
|
|
||||||
- name: PHPUnit
|
|
||||||
env:
|
|
||||||
APP_ENV: testing
|
|
||||||
APP_LOCALE: zh_CN
|
|
||||||
DB_CONNECTION: sqlite
|
|
||||||
DB_DATABASE: ':memory:'
|
|
||||||
ATTACHMENTS_DRIVER: local
|
|
||||||
AI_PROVIDER: stub
|
|
||||||
CACHE_STORE: array
|
|
||||||
QUEUE_CONNECTION: sync
|
|
||||||
SESSION_DRIVER: array
|
|
||||||
run: php artisan test --compact
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
name: Deploy (manual gate)
|
|
||||||
needs: tests
|
|
||||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: production
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Placeholder deploy hook
|
|
||||||
run: |
|
|
||||||
echo "Wire this job to your host (rsync/ssh + php artisan migrate --force + pm2 reload ecosystem.config.cjs)."
|
|
||||||
echo "See docs/ops/deploy.md"
|
|
||||||
Reference in New Issue
Block a user