-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.17 KB
/
Copy pathgo.yml
File metadata and controls
49 lines (40 loc) · 1.17 KB
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
name: CI
on: [push,pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Intsall GolangCI-Lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b . latest
- name: Run lint
run: ./golangci-lint run ./... --skip-dirs benchmarks
test:
name: Unit Testing
runs-on: ubuntu-20.04 # Has installed MySQL 8 by default.
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Set up MySQL 8.0
run: |
echo -e "Starting MySQL service, it is off by default\n"
sudo systemctl enable mysql.service
sudo systemctl start mysql.service
echo -e "Creating MySQL tables\n"
mysql -uroot -proot -e 'source ./examples/user.sql'
- name: Get dependencies
run: go get -v -t -d ./...
- name: Run tests
run: go test -v -race ./...