-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.05 KB
/
go.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
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: glauth
MYSQL_USER: glauth
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Wait for MySQL to be ready
run: |
until mysqladmin ping -h "127.0.0.1" --silent; do
echo 'waiting for mysql to be connectable...'
sleep 3
done
- name: Test
env:
DB_USERNAME: glauth
DB_PASSWORD: password
DB_HOSTNAME: 127.0.0.1
DB_PORT: 3306
DB_NAME: glauth
run: go test -v ./...