Skip to content

docs: 更新文档 #131

docs: 更新文档

docs: 更新文档 #131

Workflow file for this run

name: Mariadb
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # action 不支持非 linux 下的容器, windows-latest, macOS-latest
go: ['1.21.x', '1.22.x']
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: 创建数据库
run: |
mysql -u root -proot -h 127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS orm_test;'
- name: 安装 Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Vet
run: go vet -v ./...
- name: Test
run: go test -p=1 ./... -test.coverprofile=coverage.txt -covermode=atomic -dbs=mariadb,mysql -p=1 -parallel=1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.txt