-
Notifications
You must be signed in to change notification settings - Fork 103
67 lines (55 loc) · 1.45 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
62
63
64
65
66
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go mod download
- name: Setup configuration
run: |
sudo mkdir -p /etc/guora
sudo touch /etc/guora/configuration.yaml
echo "db:
driver: sqlite3
addr: ./guora.db
redis:
addr: localhost:6379
password:
db: 0
admin:
name: Development (开发账号)
mail: mymail
password: mypassword
secretkey: JustWriteSomethingWhatYouLike
lang: en
address: :8080" | sudo tee -a /etc/guora/configuration.yaml
- name: Build
run: go build ./cmd/guora
- name: Run test
run: |
sudo go test ./cmd/guora
sudo go test ./cmd/guora -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3