diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index e298dd44e0534d7fd45f0a1ca7b8405c9181ed8e..8219df5a4df5131814a45e8797379ca9f815bc91 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - name: size-label - uses: "guguducken/label-size-action@v0.0.1" + uses: "guguducken/label-size-action@v0.0.2" with: size_token: ${{ secrets.TOKEN_ACTION }} - ignore: ".txt,.md" + ignore: ".md,.pb.go" sizes: > { "XS":0, diff --git a/.github/workflows/ut_pr.yml b/.github/workflows/ut_pr.yml index 45d40ab13cbf0edc976166cc8f68aac182b17f9e..cc9ba292e5c1b92ece1cbe7f92b1ea238bf7450b 100644 --- a/.github/workflows/ut_pr.yml +++ b/.github/workflows/ut_pr.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Get PR Changed Paths - uses: guguducken/change-paths-action@v0.0.3 + uses: guguducken/change-paths-action@v0.0.5 id: ut-pr with: github-token: ${{ secrets.TOKEN_ACTION }} @@ -26,24 +26,31 @@ jobs: - name: Set Variables run: | echo "raw_ut_coverage='ut_coverage.raw'" >> $GITHUB_ENV + echo "ut_report='UT-Report.out'" >> $GITHUB_ENV + - name: Set up Go uses: ./matrixone/.github/actions/setup_env + - name: Build MatrixOne + run: | + cd $GITHUB_WORKSPACE/matrixone && make clean && make config && make build + - name: PR Unit Test timeout-minutes: 60 run: | cd $GITHUB_WORKSPACE/matrixone - make clean && make cgo - echo "ut start" + echo "-----------------------ut start-----------------------" CGO_CFLAGS="-I${GITHUB_WORKSPACE}/matrixone/cgo" CGO_LDFLAGS="-L${GITHUB_WORKSPACE}/matrixone/cgo -lmo -lm" - go test -v -cover -tags matrixone_test -p 1 -covermode=count --count=1 ${{ steps.ut-pr.outputs.paths }} | grep -a -P "(?m)(?<=ok|\?).*(?=%|])" | tee ${{ env.raw_ut_coverage }} + go test -v -cover -tags matrixone_test -p 1 -covermode=count --count=1 ${{ steps.ut-pr.outputs.paths }} | tee ${{ env.ut_report }} + cat ${{ env.ut_report }} | grep -a -P "(?m)(?<=ok|\?).*(?=%|])" > ${{ env.raw_ut_coverage }} echo "ut finished" - name: Coverage Calculate + continue-on-error: true run: | cd $GITHUB_WORKSPACE/matrixone echo "ut_coverage start" - awk -F '[ %\t]+' '{if($1=="ok"){if($5 == "[no"){print "warning: please move tested code file to "$2;} else if($5 < 75) {print "error: the code coverage of "$2" is "$5"% is below 75%";} else {print "The code coverage of `"$2"` is "$5"%, this is up to standard"}} else if($1 == "?"){print "error: There are no test files in this path -- "$2;}}' ${{ env.raw_ut_coverage }} - rm -rf ${{ env.raw_ut_coverage }} + awk -F '[ %\t]+' '{if($1=="ok"){if($5 == "[no"){print "Warning: please move/create test code file to `"$2"`";} else if($5 < 75) {print "Error: the code coverage of `"$2"` is "$5"% which is below 75%";} else {print "Output: The code coverage of `"$2"` is "$5"%, this is up to standard"}} else if($1 == "?"){print "Error: There are no test files in this path -- "$2;}}' ${{ env.raw_ut_coverage }} + rm -rf ${{ env.raw_ut_coverage }} ${{ env.ut_report }} echo "ut_coverage finished"