-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (48 loc) · 1.27 KB
/
version-and-test.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
name: 'Version and Test'
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
version-and-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.32
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
MYSQL_USER: user
MYSQL_PASSWORD: user
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=12
steps:
- name: Wait MySQL
run: until mysql -h'127.0.0.1' -uuser -puser test -e ";" ; do sleep 5; done
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
preferLatestVersion: true
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Show Version
run: echo $GITVERSION_SEMVER
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Test
run: go test -v ./...