mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-01-13 17:25:11 +08:00
cicd: add ci workflow
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
fa089908bd
commit
3203604045
2
.github/workflows/openim-ci.yml
vendored
2
.github/workflows/openim-ci.yml
vendored
@ -98,7 +98,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
go_version: ["1.20"]
|
||||
os: ["ubuntu-latest","macos-latest","centos-latest"]
|
||||
os: ["ubuntu-latest","centos-latest"]
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go_version }}
|
||||
uses: actions/setup-go@v2
|
||||
|
||||
52
bash.sh
52
bash.sh
@ -1,52 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
trap 'onCtrlC' INT
|
||||
function onCtrlC () {
|
||||
#捕获CTRL+C,当脚本被ctrl+c的形式终止时同时终止程序的后台进程
|
||||
kill -9 ${do_sth_pid} ${progress_pid}
|
||||
echo
|
||||
echo 'Ctrl+C is captured'
|
||||
exit 1
|
||||
}
|
||||
|
||||
do_sth() {
|
||||
#运行的主程序
|
||||
echo "++++++++++++++++++++++++"
|
||||
sleep 5
|
||||
echo "++++++++++++++++++++++++"
|
||||
|
||||
sleep 10
|
||||
}
|
||||
|
||||
progress() {
|
||||
#进度条程序
|
||||
local main_pid=$1
|
||||
local length=20
|
||||
local ratio=1
|
||||
while [ "$(ps -p ${main_pid} | wc -l)" -ne "1" ] ; do
|
||||
mark='>'
|
||||
progress_bar=
|
||||
for i in $(seq 1 "${length}"); do
|
||||
if [ "$i" -gt "${ratio}" ] ; then
|
||||
mark='-'
|
||||
fi
|
||||
progress_bar="${progress_bar}${mark}"
|
||||
done
|
||||
printf "Progress: ${progress_bar}\r"
|
||||
ratio=$((ratio+1))
|
||||
#ratio=`expr ${ratio} + 1`
|
||||
if [ "${ratio}" -gt "${length}" ] ; then
|
||||
ratio=1
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
do_sth &
|
||||
do_sth_pid=$(jobs -p | tail -1)
|
||||
|
||||
progress "${do_sth_pid}" &
|
||||
progress_pid=$(jobs -p | tail -1)
|
||||
|
||||
wait "${do_sth_pid}"
|
||||
printf "Progress: done \n"
|
||||
Loading…
x
Reference in New Issue
Block a user