From 42dab9f1a86ab362335c8378db50a73ccf04010f Mon Sep 17 00:00:00 2001 From: jiangxin Date: Mon, 26 Aug 2024 18:53:04 +0800 Subject: [PATCH 1/5] update for pr_coverage.out --- .github/workflows/utils.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/utils.yaml b/.github/workflows/utils.yaml index 3ff40c6..22eca3a 100644 --- a/.github/workflows/utils.yaml +++ b/.github/workflows/utils.yaml @@ -216,8 +216,20 @@ jobs: python $GITHUB_WORKSPACE/parse_coverage.py -coverage_files $GITHUB_WORKSPACE/matrixone/ut_coverage.out $GITHUB_WORKSPACE/matrixone/bvt_coverage.out -diff_path $GITHUB_WORKSPACE/matrixone/diff.patch - name: Compress final result files + id: compress_result if: ${{ always() && !cancelled() }} run: | + cd $GITHUB_WORKSPACE + if [ ! -f "$GITHUB_WORKSPACE/pr_coverage.out" ]; then + echo "pr_coverage.out does not exist." + echo "The code block has not changed,skip the remaining steps." + echo "file_exists=false" >> $GITHUB_OUTPUT + exit 1 + else + echo "pr_coverage.out exists." + echo "file_exists=true" >> $GITHUB_OUTPUT + fi + cd $GITHUB_WORKSPACE/matrixone cp $GITHUB_WORKSPACE/pr_coverage.out $GITHUB_WORKSPACE/matrixone/pr_coverage.out go tool cover -o pr_coverage.html -html=pr_coverage.out @@ -231,7 +243,7 @@ jobs: zip -r final_result_files.zip pr_coverage.html pr_coverage.out merged_coverage.out - name: Upload final result files uses: actions/upload-artifact@v4 - if: ${{ always() && !cancelled() }} + if: ${{ always() && !cancelled() && steps.compress_result.outputs.file_exists == 'true' }} continue-on-error: true with: name: final-result-files From c32bc9531439ea7af8081d53d1f65f873ec3763b Mon Sep 17 00:00:00 2001 From: jiangxin Date: Mon, 26 Aug 2024 20:35:27 +0800 Subject: [PATCH 2/5] update runner to use amd64-mo-guangzhou-2xlarge16 --- .github/workflows/utils.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/utils.yaml b/.github/workflows/utils.yaml index 22eca3a..a63a064 100644 --- a/.github/workflows/utils.yaml +++ b/.github/workflows/utils.yaml @@ -79,7 +79,7 @@ jobs: if: ${{ needs.check_organization_user.outputs.safe_label == '1' || needs.check_organization_user.outputs.in_org == '1' }} name: PR Unit and BVT Test Coverage needs: [check_organization_user] - runs-on: ubuntu-22.04 + runs-on: amd64-mo-guangzhou-2xlarge16 steps: - uses: actions/checkout@v4 with: From 6ab5e903b4c6da98e475211066ae863cea0f9712 Mon Sep 17 00:00:00 2001 From: jiangxin Date: Mon, 26 Aug 2024 22:19:36 +0800 Subject: [PATCH 3/5] update --- .github/workflows/utils.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/utils.yaml b/.github/workflows/utils.yaml index a63a064..922d869 100644 --- a/.github/workflows/utils.yaml +++ b/.github/workflows/utils.yaml @@ -221,8 +221,7 @@ jobs: run: | cd $GITHUB_WORKSPACE if [ ! -f "$GITHUB_WORKSPACE/pr_coverage.out" ]; then - echo "pr_coverage.out does not exist." - echo "The code block has not changed,skip the remaining steps." + echo "pr_coverage.out does not exist.The code block has not changed,skip the remaining steps." echo "file_exists=false" >> $GITHUB_OUTPUT exit 1 else From 33aa342ee2c2944f85d35991030822c4095893e1 Mon Sep 17 00:00:00 2001 From: jiangxin Date: Mon, 26 Aug 2024 22:55:16 +0800 Subject: [PATCH 4/5] update exit 0 --- .github/workflows/utils.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/utils.yaml b/.github/workflows/utils.yaml index 922d869..051c98c 100644 --- a/.github/workflows/utils.yaml +++ b/.github/workflows/utils.yaml @@ -104,7 +104,7 @@ jobs: - name: Set up Go and JAVA uses: matrixorigin/CI/actions/setup-env@main with: - setup-java: true + setup-java: false - name: Set Variables run: | echo "ut_report='UT-Report.out'" >> $GITHUB_ENV @@ -117,6 +117,10 @@ jobs: echo "ut_excluded_pkg='pkg/pb\|pkg/sql/parsers/goyacc\|yaccpar'" >> $GITHUB_ENV echo "bvt_excluded_pkg='pkg/pb\|yaccpar'" >> $GITHUB_ENV + - name: Set JAVA PATH + run: | + echo "$JAVA_HOME/bin" >> $GITHUB_PATH + - name: Clone test-tool repository uses: actions/checkout@v4 with: @@ -223,12 +227,11 @@ jobs: if [ ! -f "$GITHUB_WORKSPACE/pr_coverage.out" ]; then echo "pr_coverage.out does not exist.The code block has not changed,skip the remaining steps." echo "file_exists=false" >> $GITHUB_OUTPUT - exit 1 - else - echo "pr_coverage.out exists." - echo "file_exists=true" >> $GITHUB_OUTPUT + exit 0 fi - + + echo "file_exists=true" >> $GITHUB_OUTPUT + cd $GITHUB_WORKSPACE/matrixone cp $GITHUB_WORKSPACE/pr_coverage.out $GITHUB_WORKSPACE/matrixone/pr_coverage.out go tool cover -o pr_coverage.html -html=pr_coverage.out From 4f2619e73556f836954412633674963abe2a31a5 Mon Sep 17 00:00:00 2001 From: jiangxin Date: Mon, 26 Aug 2024 23:03:39 +0800 Subject: [PATCH 5/5] update python fetch-depth --- .github/workflows/utils.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/utils.yaml b/.github/workflows/utils.yaml index 051c98c..efa67d7 100644 --- a/.github/workflows/utils.yaml +++ b/.github/workflows/utils.yaml @@ -208,7 +208,7 @@ jobs: uses: actions/checkout@v3 with: repository: matrixorigin/CI - fetch-depth: "0" + fetch-depth: "1" path: CI - name: Get Python file run: |