Skip to content

Commit

Permalink
👷 添加 GitHub 自动测试 CI 工作流
Browse files Browse the repository at this point in the history
Signed-off-by: liutianqi <[email protected]>
  • Loading branch information
iTanken committed Nov 24, 2023
1 parent 37ea306 commit 7d7c062
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
dameng:

strategy:
matrix:
db-version: ['danilaworker/damengdb:8.1.2']
go-version: ['1.18', '1.19', '1.20', '1.21.x']
platform: [ubuntu-latest] # can not run in macOS and Windows OS
runs-on: ${{ matrix.platform }}

services:
dameng:
image: ${{ matrix.db-version }}
env:
PAGE_SIZE: 16
EXTENT_SIZE: 32
BLANK_PAD_MODE: 1
LOG_SIZE: 1024
UNICODE_FLAG: 1
LENGTH_IN_CHAR: 1
LD_LIBRARY_PATH: /opt/dmdbms/bin
INSTANCE_NAME: dm8_test
ports:
- 30236:5236
volumes:
- /data/dm8_test:/opt/dmdbms/data
options: >-
--restart=always
--privileged=true
steps:

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: go mod tidy
run: go mod tidy

- name: Check DM8 port
run: |
if ss -tln | grep -q ":30236 "; then
echo "DM8 服务端口号正常!"
else
echo "DM8 服务端口号异常!"
fi
go run github.com/cloverstd/tcping@latest 127.0.0.1:30236
- name: Tests
run: DM_HOST=127.0.0.1 DM_PORT=30236 DM_PASSWORD=SYSDBA001 go test -v ./...

0 comments on commit 7d7c062

Please sign in to comment.