-
Notifications
You must be signed in to change notification settings - Fork 7
108 lines (95 loc) · 2.55 KB
/
tests.yaml
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
name: Tests
on: [push, pull_request]
env:
TEST_DATABASE_NAME: sqlxadapter_test
TEST_DATABASE_USER: blank
TEST_DATABASE_PASSWORD: Sqlx-adapter_test
jobs:
test-all:
name: test-all
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
go:
- '1.23.x'
- '1.22.x'
- '1.21.x'
mysql:
- '8.0'
postgres:
- '15'
sqlserver:
- 'latest'
runs-on: ${{ matrix.os }}
services:
mysql:
image: mysql:${{ matrix.mysql }}
env:
MYSQL_DATABASE: ${{ env.TEST_DATABASE_NAME }}
MYSQL_ROOT_PASSWORD: ${{ env.TEST_DATABASE_PASSWORD }}
MYSQL_USER: ${{ env.TEST_DATABASE_USER }}
MYSQL_PASSWORD: ${{ env.TEST_DATABASE_PASSWORD }}
ports:
- 3306:3306
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_DB: ${{ env.TEST_DATABASE_NAME }}
POSTGRES_USER: ${{ env.TEST_DATABASE_USER }}
POSTGRES_PASSWORD: ${{ env.TEST_DATABASE_PASSWORD }}
ports:
- 5432:5432
sqlserver:
image: mcmoe/mssqldocker:${{ matrix.sqlserver }}
env:
ACCEPT_EULA: "Y"
MSSQL_DB: ${{ env.TEST_DATABASE_NAME }}
SA_PASSWORD: ${{ env.TEST_DATABASE_PASSWORD }}
MSSQL_USER: ${{ env.TEST_DATABASE_USER }}
MSSQL_PASSWORD: ${{ env.TEST_DATABASE_PASSWORD }}
ports:
- 1433:1433
steps:
- name: 01_Checkout_Code
uses: actions/checkout@v4
- name: 02_Install_go_${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: 03_Run_Tests
run: |
make run-test
- name: 04_Send_Coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
flag-name: Go-${{ matrix.go }}
parallel: true
finish:
needs:
- test-all
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
semantic-release:
needs:
- test-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Release
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx [email protected]