-
-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (47 loc) · 1.34 KB
/
tests.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
58
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
services:
oracle:
image: truevoly/oracle-12c
env:
TZ: Asia/Shanghai
WEB_CONSOLE: false
ports:
- 30256:1521
# volumes:
# - /data/oracle_test:/u01/app/oracle
options: >-
--restart=always
--privileged=true
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Tidy
run: go mod tidy
- name: Build
run: go build -v ./...
- name: Check oracle port
run: |
if ss -tln | grep -q ":30256 "; then
echo "oracle 服务端口号正常!"
else
echo "oracle 服务端口号异常!"
fi
go run github.com/cloverstd/tcping@latest 127.0.0.1:30256
- name: Test
env:
GORM_ORA_DSN: "oracle://system:oracle@localhost:30256/xe?LANGUAGE=SIMPLIFIED+CHINESE&TERRITORY=CHINA"
GORM_ORA_WAIT_MIN: 5 # wait for the database initialization to complete
run: go test -timeout 20m -v ./...