ci: prepare sqlite env in verify job; remove GitHub-only workflow
Build and Deploy / verify (push) Failing after 5s
Build and Deploy / deploy (push) Skipped

This commit is contained in:
2026-09-07 19:10:18 +00:00
parent b491c8ac86
commit 2301f7075e
4 changed files with 62 additions and 94 deletions
+6
View File
@@ -15,6 +15,12 @@ jobs:
php -r 'exit(PHP_VERSION_ID >= 80200 ? 0 : 1);'
node --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
run: |
composer install --no-interaction --prefer-dist
-94
View File
@@ -1,94 +0,0 @@
name: CI
on:
push:
branches: [main, master, develop]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: laralog_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -proot"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, dom, pdo_mysql, sqlite3, gd, redis
coverage: none
- name: Cache Composer
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Env
run: |
cp .env.example .env
php artisan key:generate
touch database/database.sqlite
- name: Lint
run: |
find app plugins config database -name '*.php' -print0 | xargs -0 -n1 php -l
- name: Migrate & Seed (sqlite)
run: php artisan migrate --seed --force
- name: Run tests (sqlite)
run: php artisan test
# 生产走 MySQL:可选并行 MySQL 测试
- name: Run tests (mysql)
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: laralog_test
DB_USERNAME: root
DB_PASSWORD: root
run: php artisan test
# 生产部署示例(SSH + rsync)。真实环境按需开启并配置 secrets:
# DEPLOY_HOST / DEPLOY_USER / DEPLOY_PATH / DEPLOY_SSH_KEY
deploy:
if: github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Deploy via SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
cd ${{ secrets.DEPLOY_PATH }}
git pull origin main
composer install --no-dev --no-interaction --prefer-dist
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan theme:publish
pm2 restart laralog-workerman laralog-schedule || pm2 start ecosystem.config.js
+19
View File
@@ -0,0 +1,19 @@
schema_version: 1
generated_at: "2026-08-13T10:34:55Z"
php:
version: 8.2.30
path: /Users/admin/Library/Application Support/Herd/bin//php
extensions:
- name: redis
constraint: '*'
installed: 6.3.0
loaded: true
- name: swoole
constraint: ^6.0
installed: 6.2.1
loaded: true
- name: xdebug
constraint: '*'
installed: ""
loaded: false
services: []
+37
View File
@@ -0,0 +1,37 @@
# xpier 项目钉定配置(可选:没有它 xpier 也能自动检测)
# 所有字段都可选,不需要的直接删掉或保持注释。字段说明见 docs/architecture.md。
runtime: fpm # 项目类型/运行时(决定 xpier up 怎么处理):
# ┌ fpm 标准 PHP / Laravel —— 无需 up:cd 项目 && xpier link,nginx+php-fpm 直接服务,访问 <目录名>.test
# ├ static 静态站点 —— 同 fpm,link 后 nginx 直接出文件
# ├ hyperf Hyperf 常驻服务 —— 在下方 apps: 写启动命令,xpier up 拉起
# ├ swoole Swoole 常驻服务 —— 同 hyperf
# └ frankenphp FrankenPHP —— 同 hyperf
# php: "8.4" # 钉定 PHP 版本(如 "8.2" / "8.4")
extensions: # 需要的 PHP 扩展(键=扩展名, 值=版本约束)
swoole: "^6.0" # 约束:"*" 任意 / "^6.0" / ">=6.0"
redis: "*"
xdebug: "*"
# 装法:xpier sync --apply 或 xpier ext:install swoole --php 8.4
# services: # 依赖的系统服务(sync --apply 会 brew 安装)
# - mysql
# - redis
apps: # 多应用编排(与 dev.yaml 同构,dev.yaml 优先;两种条目可混用)
# # 网站型:无 cmd —— up 自动注册站点(相当于 link),nginx+php-fpm 直接服务
blog:
dir: . # 可选,默认当前目录
domain: larablog.test # 必填:访问域名
secure: true # 可选:开启 https(默认 http)
php: "8.4" # 可选:固定 PHP 版本
# # 进程型:有 cmd —— up 托管常驻进程(Hyperf/vite...)
# php-server:
# dir: /path
# cmd: php bin/hyperf.php server:watch
# ports: ["9501"]
# domain: api.test # 可选:生成 nginx 反代
# node: "20" # 可选:经 nvm 固定 Node
# extensions: [swoole] # 可选:启动前检查扩展