59
59
goos : linux
60
60
61
61
runs-on : ${{ matrix.os }}
62
+ services :
63
+ # Label used to access the service container
64
+ redis :
65
+ # Docker Hub image
66
+ image : redis
67
+ # Set health checks to wait until redis has started
68
+ options : >-
69
+ --health-cmd "redis-cli ping"
70
+ --health-interval 10s
71
+ --health-timeout 5s
72
+ --health-retries 5
73
+ ports :
74
+ # Maps port 6379 on service container to the host
75
+ - 6379:6379
76
+ # TODO 拉起一个PG docker 实例
62
77
steps :
63
78
# Setup the environment.
64
79
- name : Setup Go
@@ -74,44 +89,61 @@ jobs:
74
89
env :
75
90
GOOS : ${{ matrix.goos }}
76
91
GOARCH : ${{ matrix.goarch }}
77
- run : make build
92
+ run : make build STORE_PG_PLUGIN_VERSION= POLARIS_SERVER_VERSION=v1.17.2
78
93
79
94
# Run interface tests
80
95
- name : run tests
81
96
run : |
82
- # work_dir=$(ls | grep polaris-server-release | sed -n '1p')
83
- # echo "work_dir is $work_dir"
84
- # cd $work_dir
97
+ export STORE_MODE=sqldb
98
+ echo "cur STORE MODE=${STORE_MODE}"
99
+
100
+ # # 设置严格模式
101
+ # mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'";
102
+ # # 清空数据
103
+ # mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "DROP DATABASE IF EXISTS polaris_server";
104
+ # # 初始化 polaris 数据库
105
+ # mysql -h127.0.0.1 -P3306 -uroot -p"polaris" < store/mysql/scripts/polaris_server.sql
106
+ # # 临时放开 DB 的最大连接数
107
+ # mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "set GLOBAL max_connections = 3000;"
108
+
85
109
86
- # ls -alR
87
-
88
- # if [[ "$(uname)" == "Darwin" ]]; then
89
- # # Mac OS X 操作系统
90
- # echo "Run on MacOS"
91
- # # sed -i '' 's/consoleOpen: true/consoleOpen: false/g' conf/polaris-server.yaml
92
- # else
93
- # # GNU/Linux操作系统
94
- # echo "Run on Linux"
95
- # # sed -i 's/consoleOpen: \(true\|false\)/consoleOpen: false/g' conf/polaris-server.yaml
96
- # fi
97
-
98
- # chmod +x ./tool/*.sh
99
- # ./tool/start.sh
100
-
101
- # sleep 120s
102
- # ls -alR
103
- # cat ./log/stdout 2>&1
104
-
105
- # cd ..
106
- # ls -lstrh
107
- # # 先测试普通的集成测试
108
- # pushd ./test/integrate
109
- # echo "[INTEGRATION TEST] begin"
110
- # curl http://127.0.0.1:8090
111
- # go test -count=1 -v -tags integration
112
- # echo "[INTEGRATION TEST] end"
113
- # popd
114
- # cd $work_dir
115
- # ./tool/stop.sh
116
- # cd ..
110
+ work_dir="build_resource/polaris/polaris-server-release-xxxx"
111
+ work_dir=$(ls | grep polaris-server-release | sed -n '1p')
112
+ echo "work_dir is $work_dir"
113
+
114
+ cp -rf ./test/data/polaris-server.yaml $work_dir/
115
+
116
+ cd $work_dir
117
+
118
+ ls -alR
119
+
120
+ if [[ "$(uname)" == "Darwin" ]]; then
121
+ # Mac OS X 操作系统
122
+ echo "Run on MacOS"
123
+ # sed -i '' 's/consoleOpen: true/consoleOpen: false/g' conf/polaris-server.yaml
124
+ else
125
+ # GNU/Linux操作系统
126
+ echo "Run on Linux"
127
+ # sed -i 's/consoleOpen: \(true\|false\)/consoleOpen: false/g' conf/polaris-server.yaml
128
+ fi
129
+
130
+ chmod +x ./tool/*.sh
131
+ ./tool/start.sh
132
+
133
+ sleep 120s
134
+ ls -alR
135
+ cat ./log/stdout 2>&1
136
+
137
+ cd ..
138
+ ls -lstrh
139
+ # 先测试普通的集成测试
140
+ pushd ./test/integrate
141
+ echo "[INTEGRATION TEST] begin"
142
+ curl http://127.0.0.1:8090
143
+ go test -count=1 -v -tags integration -timeout 60m
144
+ echo "[INTEGRATION TEST] end"
145
+ popd
146
+ cd $work_dir
147
+ ./tool/stop.sh
148
+ cd ..
117
149
0 commit comments