-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.15 KB
/
go-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
name: go-test
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
test:
strategy:
matrix:
include:
- database: mariadb
db_url: mysql://root:root@localhost/test_suite_controller?sql_mode=%27ANSI_QUOTES%27
- database: postgres
db_url: postgresql://root:root@localhost/test_suite_controller?sslmode=disable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- if: ${{ matrix.database == 'mariadb' }}
name: Run MariaDB
uses: getong/[email protected]
with:
mysql database: 'test_suite_controller'
mysql root password: root
- if: ${{ matrix.database == 'postgres' }}
name: Run PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: '13'
postgresql db: 'test_suite_controller'
postgresql user: root
postgresql password: root
- name: Test
run: go test -v ./...
env:
DB_URL: ${{ matrix.db_url }}