feat: 完善后端脚手架基础能力
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25.x"
|
||||
cache: true
|
||||
- run: go test ./...
|
||||
- run: go vet ./...
|
||||
- run: ./scripts/build.sh
|
||||
|
||||
integration:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_USER: skeleton
|
||||
POSTGRES_PASSWORD: skeleton
|
||||
POSTGRES_DB: skeleton
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U skeleton"
|
||||
--health-interval 5s --health-timeout 3s --health-retries 20
|
||||
mysql:
|
||||
image: mysql:8.4
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: skeleton
|
||||
MYSQL_USER: skeleton
|
||||
MYSQL_PASSWORD: skeleton
|
||||
ports:
|
||||
- 3306:3306
|
||||
options: >-
|
||||
--health-cmd "mysqladmin ping -h localhost -proot"
|
||||
--health-interval 5s --health-timeout 3s --health-retries 30
|
||||
env:
|
||||
TEST_POSTGRES_DSN: postgres://skeleton:skeleton@127.0.0.1:5432/skeleton?sslmode=disable
|
||||
TEST_MYSQL_DSN: skeleton:skeleton@tcp(127.0.0.1:3306)/skeleton?charset=utf8mb4&parseTime=True&loc=Local
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25.x"
|
||||
cache: true
|
||||
- run: go test -tags=integration ./database
|
||||
Reference in New Issue
Block a user