-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.71 KB
/
golang.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Go package
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# action文档:
# https://github.com/marketplace/actions/setup-mysql
- uses: mirromutth/[email protected]
with:
host port: 3306 # Optional, default value is 3306. The port of host
# container port: 3306 # Optional, default value is 3306. The port of container
# character set server: 'utf8mb4' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
# collation server: 'utf8mb4_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
# mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
mysql database: 'storage_lock_test' # Optional, default value is "test". The specified database which will be create
# 只在本地和CI测试中临时使用,就直接写死在这里了
mysql root password: 'UeGqAm8CxYGldMDLoNNt' # Required if "mysql user" is empty, default is empty. The root superuser password
# mysql user: 'developer' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
# mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user"
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Test
run: go test -v ./...
env:
STORAGE_LOCK_MYSQL_DSN: "root:UeGqAm8CxYGldMDLoNNt@tcp(127.0.0.1:3306)/storage_lock_test"