This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (85 loc) · 2.29 KB
/
release.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Release
on:
push:
tags:
- v*
jobs:
Release:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-management
env:
RABBITMQ_DEFAULT_USER: root
RABBITMQ_DEFAULT_PASS: 123456
ports:
- 5672:5672
- 15672:15672
redis:
image: redis:latest
ports:
- 6379:6379
etcd:
image: bitnami/etcd:3.5.0
env:
ALLOW_NONE_AUTHENTICATION: yes
ports:
- 2379:2379
- 2380:2380
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: 123456
MYSQL_USER: db
MYSQL_PASSWORD: 123456
MYSQL_DATABASE: test
ports:
- 3306:3306
mock_id:
image: tsundata/mock_id:latest
ports:
- 6012:6012
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.17
- name: Install Task
uses: arduino/setup-task@v1
### Lint ###
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.45.2
### Build ###
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
install-only: true
- name: Build
run: task build
### Test ###
- name: Import Config and Migrate
run: |
export ETCD_ADDRESS=127.0.0.1:2379
cp configs/common.yml.example configs/common.yml
cp configs/gateway.yml.example configs/gateway.yml
cp configs/web.yml.example configs/web.yml
cp configs/classifier.yml.example configs/classifier.yml
ls -all configs
go run github.com/tsundata/assistant/cmd/cli config
go run github.com/tsundata/assistant/cmd/cli migrate
- name: Run test cases
run: |
export ETCD_ADDRESS=127.0.0.1:2379
task test
task coverage
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
### Release ###
- name: Release
run: GOVERSION=$(go version) goreleaser release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}