diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6701c0af..ccee0595 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,19 +12,19 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: cpplint-check: - name: cpplint check + name: Lint runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 with: fetch-depth: 2 - - name: prepare env + - name: Prepare Env run: | python -m pip install --upgrade pip pip install cpplint export PATH=$PATH:~/.local/bin/ cpplint --version - - name: lint + - name: Lint run: | export PATH=$PATH:~/.local/bin/ files=`git diff --name-only HEAD HEAD~1` @@ -47,20 +47,72 @@ jobs: fi done - build: + build-test: needs: [cpplint-check] - name: build + name: Build-Test runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 with: fetch-depth: 2 - - name: init submodules + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - name: Set Up TCL + run: sudo apt-get install tcl8.5 + - name: Init Submodules run: | git submodule update --init --recursive - - name: build Tendis + - name: Build run: | mkdir build && cd build cmake .. - cmake --build . -j2 \ No newline at end of file + cmake --build . -j2 + - name: Restore Test + run: | + cd build/bin + ./restore_test --gtest_throw_on_failure + shell: bash + - name: Repl Test + run: | + cd build/bin + ./repl_test --gtest_throw_on_failure + shell: bash + - name: Cluster Test + run: | + cd build/bin + ./cluster_test --gtest_throw_on_failure + shell: bash + - name: Unit Test + run: | + bash unittest.sh + errcnt1=`grep -E "Expected|FAILED" unittest.log |wc -l` + if [ $errcnt1 -ne 0 ]; then + echo "really xxx judge" + grep -E "Expected|FAILED" unittest.log + exit $errcnt1 + fi + shell: bash + - name: Redis Test + run: | + bash redistest.sh | tee temp_redistest.log + errcnt2=`grep -E "\[err|\[exception|49merr|49mexception" redistest.log|wc -l` + if [ $errcnt2 -ne 0 ]; then + grep -E "\[err|\[exception|49merr|49mexception" redistest.log + fi + exit $errcnt2 + shell: bash + - name: GoTest + run: | + cd src/tendisplus/integrate_test + bash ./gotest.sh | tee go-test2.log + cd - + errcnt2=`grep "go passed" src/tendisplus/integrate_test/gotest.log|wc -l` + if [ $errcnt2 -ne 6 ]; then + grep "fatal" src/tendisplus/integrate_test/gotest.log + grep "go passed" src/tendisplus/integrate_test/gotest.log + exit $errcnt2 + fi + shell: bash diff --git a/mkreleasehdr.sh b/mkreleasehdr.sh index 6d36f68f..f9d1b4f4 100755 --- a/mkreleasehdr.sh +++ b/mkreleasehdr.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1` GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l` BUILD_ID=`uname -n`"-"`date +%s` diff --git a/redis_cluster_test.sh b/redis_cluster_test.sh index 544f0ae6..c1623cd6 100644 --- a/redis_cluster_test.sh +++ b/redis_cluster_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash tclsh tests/cluster/run.tcl --single 00-base.tcl tclsh tests/cluster/run.tcl --single 01-faildet.tcl tclsh tests/cluster/run.tcl --single 02-failover.tcl diff --git a/redistest.sh b/redistest.sh index 5d559e4b..3a1a5302 100644 --- a/redistest.sh +++ b/redistest.sh @@ -1,3 +1,4 @@ +#!/bin/bash logfile=./redistest.log rm $logfile diff --git a/src/tendisplus/integrate_test/gotest.sh b/src/tendisplus/integrate_test/gotest.sh index 867df7d3..f4145a9b 100755 --- a/src/tendisplus/integrate_test/gotest.sh +++ b/src/tendisplus/integrate_test/gotest.sh @@ -1,3 +1,4 @@ +#!/bin/bash logfile="gotest.log" rm -f $logfile diff --git a/testall.sh b/testall.sh index 1c8f91aa..59052ffd 100644 --- a/testall.sh +++ b/testall.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash sh ./unittest.sh >&unittest.log & diff --git a/unittest.sh b/unittest.sh index 88f00f8a..e38ed56b 100644 --- a/unittest.sh +++ b/unittest.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash logfile=./unittest.log rm $logfile