-
Notifications
You must be signed in to change notification settings - Fork 28
100 lines (98 loc) · 2.57 KB
/
main.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
name: CI
on:
# Validate on push for Renovate auto merge without PR
push:
branches:
- 'master'
- 'renovate/**'
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- run: go mod download
- run: make traQ
- uses: actions/upload-artifact@v4
with:
name: traQ
path: traQ
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: '--timeout 3m0s'
test:
name: Test
runs-on: ubuntu-latest
needs: [build]
services:
mysql:
image: mariadb:10.11.9
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: Run tests
run: |
export TRAQ_IMAGEMAGICK=`which convert`
go test ./... -coverprofile=coverage.txt -race -shuffle=on -vet=off
env:
MARIADB_HOSTNAME: 127.0.0.1
MARIADB_PORT: 3306
MARIADB_USERNAME: root
MARIADB_PASSWORD: password
- name: Upload coverage data
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
tbls:
name: TBLS
runs-on: ubuntu-latest
needs: [build]
services:
mysql:
image: mariadb:10.11.9
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: traq
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: traQ
- uses: k1low/setup-tbls@v1
with:
version: v1.65.3
- run: |
chmod +x ./traQ
./traQ migrate --reset
tbls lint
env:
TRAQ_MARIADB_HOST: 127.0.0.1
TRAQ_MARIADB_PORT: 3306
TRAQ_MARIADB_USERNAME: root
TRAQ_MARIADB_PASSWORD: password
TRAQ_MARIADB_DATABASE: traq
TBLS_DSN: 'mariadb://root:[email protected]:3306/traq'