-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.32 KB
/
ci.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: golang-test
on:
push:
branches:
- develop
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
check:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_PASSWORD: root
MYSQL_DATABASE: todo
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: set MySQL sql_mode
run: |
mysql --protocol=tcp --host 127.0.0.1 -proot -u root mysql <<SQL
SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
SET GLOBAL character_set_server = 'utf8mb4';
SET GLOBAL collation_server = 'utf8mb4_general_ci';
SQL
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
cache: true
- run: go mod download
- name: Build
run: go build .
- name: Fmt
run: make fmt
- name: Test
run: make test
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
tool_name: errcheck
level: info