-
Notifications
You must be signed in to change notification settings - Fork 7
201 lines (171 loc) · 4.84 KB
/
test.yml
File metadata and controls
201 lines (171 loc) · 4.84 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
test:
strategy:
matrix:
go-version: [1.25.x]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Build UI
run: |
cd ui
npm ci
npm run build --if-present
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up dependencies
run: |
go mod download
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.4.0
args: --timeout=10m
- name: Unit Tests
run: go test -race -v $(go list ./... | grep -v /test/) -coverprofile=coverage.out
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
flag-name: Go-${{ matrix.go }}
parallel: true
integration-test:
needs: test
strategy:
matrix:
distro: [ 'debian:trixie', 'ubuntu:24.04' ]
database: [ sqlite, postgres, mysql ]
go-version: [ 1.25.x ]
experimental: [ false ]
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
container:
image: ${{ matrix.distro }}
options: --user root
volumes:
- /usr/local/share/ca-certificates:/usr/local/share/ca-certificates
steps:
- name: Container preparation
run: |
apt -y update
apt-get install ca-certificates -y
update-ca-certificates
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '24.x'
- name: Build UI
run: |
cd ui
npm ci
npm run build --if-present
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up dependencies
run: go mod download
- name: GameAP Installation Test
run: |
cd cmd/gameapctl/
go build .
./gameapctl --non-interactive panel install --version 4 --host=127.0.0.1 --database=${{ matrix.database}}
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs_v4
path: /var/log/
retention-days: 5
integration-test-windows:
needs: test
strategy:
matrix:
database: [ sqlite, postgres, mysql ]
go-version: [ 1.25.x ]
experimental: [ false ]
runs-on: windows-latest
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Build UI
run: |
cd ui
npm ci
npm run build --if-present
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up dependencies
run: go mod download
- name: Tests
run: |
sc delete nginx
del C:\tools\nginx* -Recurse -Force
cd .\cmd\gameapctl\
go build .
.\gameapctl.exe --non-interactive panel install --version=4 --host=127.0.0.1 --port=3080 --database=${{ matrix.database}}
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs_windows_v4
path: |
~/AppData/Local/Temp/gameapctl*
C:/gameap/services/*
C:/gameap/logs/*
retention-days: 5
test-cache:
needs: [test, integration-test, integration-test-windows]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.25.x
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
finish:
needs: [test, integration-test, integration-test-windows]
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true