Skip to content

👷 添加 GitHub 自动测试 CI 工作流 #30

👷 添加 GitHub 自动测试 CI 工作流

👷 添加 GitHub 自动测试 CI 工作流 #30

Workflow file for this run

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 ./...