-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (95 loc) · 2.92 KB
/
go-test-linux.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
109
110
111
112
name: Go test linux
on: [push]
env:
LD_LIBRARY_PATH: /opt/senzing/er/lib:/opt/oracle/instantclient_23_5
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
permissions:
contents: read
jobs:
go-test-linux:
name: "Go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [ubuntu-latest]
services:
oracle:
env:
ORACLE_PWD: Passw0rd
image: container-registry.oracle.com/database/free
ports:
- 1521:1521
mssql:
env:
ACCEPT_EULA: Y
MSSQL_PID: Developer
MSSQL_SA_PASSWORD: Passw0rd
image: mcr.microsoft.com/mssql/server
ports:
- 1433:1433
mysql:
env:
MYSQL_DATABASE: G2
MYSQL_PASSWORD: mysql
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: mysql
image: bitnami/mysql
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
postgres:
env:
POSTGRES_DB: G2
POSTGRES_PASSWORD: postgres
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Make empty G2C.db
run: |
mkdir /tmp/sqlite
touch /tmp/sqlite/G2C.db
- name: Install Oracle SDK
run: |
curl --output /tmp/instantclient-basic-linux.zip https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
sudo mkdir -p /opt/oracle
sudo unzip -d /opt/oracle /tmp/instantclient-basic-linux.zip
sudo apt-get install libaio1 libaio-dev
- name: Run go test
run: go test -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: cover.out
path: ./cover.out
- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
coverage:
name: Coverage
needs: go-test-linux
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
with:
coverage-config: ./.github/coverage/testcoverage.yaml