Skip to content

Commit

Permalink
增加CI
Browse files Browse the repository at this point in the history
  • Loading branch information
CC11001100 committed Aug 7, 2023
1 parent 4e7f28b commit 6c1e9f0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Go package

on: [ push ]

jobs:
build:

runs-on: ubuntu-latest
steps:

# action文档
# https://github.com/marketplace/actions/start-mariadb
- uses: getong/[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
mariadb version: '10.4.10' # Optional, default value is "latest". The version of the MariaDB
mysql database: 'storage_lock_test' # Optional, default value is "test". The specified database which will be create
# 这里就直接写死了
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_MARIA_DSN: "root:UeGqAm8CxYGldMDLoNNt@tcp(127.0.0.1:3306)/storage_lock_test"

0 comments on commit 6c1e9f0

Please sign in to comment.