From e03d5564a0db07b4f3d52a9d8c8e1705b5275a18 Mon Sep 17 00:00:00 2001 From: lcxznpy <444346216@qq.com> Date: Sun, 28 Apr 2024 16:00:30 +0800 Subject: [PATCH] change setup go and java path --- .github/workflows/ci.yaml | 38 +++--- .github/workflows/e2e-compose.yaml | 30 ++--- .github/workflows/e2e-standalone.yaml | 44 ++----- .github/workflows/e2e-upgrade.yaml | 44 +++---- .../workflows/merge-trigger-standalone.yaml | 33 ++--- .github/workflows/release.yaml | 39 +++--- .github/workflows/robot.yaml | 41 +++--- .github/workflows/utils.yaml | 117 ++++++++---------- 8 files changed, 171 insertions(+), 215 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 05e6f4b..24c8987 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,45 +5,47 @@ on: workflow_call: secrets: S3ENDPOINT: - description: 'S3ENDPOINT For Test' + description: "S3ENDPOINT For Test" required: true S3REGION: - description: 'S3REGION For Test' + description: "S3REGION For Test" required: true S3APIKEY: - description: 'S3APIKEY For Test' + description: "S3APIKEY For Test" required: true S3APISECRET: - description: 'S3APISECRET For Test' + description: "S3APISECRET For Test" required: true S3BUCKET: - description: 'S3BUCKET For Test' + description: "S3BUCKET For Test" required: true jobs: ut-linux-x86: runs-on: ubuntu-latest - name: UT Test on Ubuntu/x86 + name: UT Test on Ubuntu/x86 steps: - uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: Set up Go - uses: ./.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false - name: Set env run: | echo "endpoint=${{ secrets.S3ENDPOINT }}" >> $GITHUB_ENV echo "region=${{ secrets.S3REGION }}" >> $GITHUB_ENV echo "apikey=${{ secrets.S3APIKEY }}" >> $GITHUB_ENV echo "apisecret=${{ secrets.S3APISECRET }}" >> $GITHUB_ENV - echo "bucket=${{ secrets.S3BUCKET }}" >> $GITHUB_ENV + echo "bucket=${{ secrets.S3BUCKET }}" >> $GITHUB_ENV - name: Unit Testing run: | cd $GITHUB_WORKSPACE && make clean && make config make ut UT_PARALLEL=6 - + ut-mac-x86: if: ${{ !github.event.pull_request.draft }} runs-on: macos-12 @@ -52,11 +54,13 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: Set up Go - uses: ./.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false - name: Set env run: | echo "endpoint=${{ secrets.S3ENDPOINT }}" >> $GITHUB_ENV @@ -68,14 +72,14 @@ jobs: run: | cd $GITHUB_WORKSPACE && make clean && make config make ut UT_PARALLEL=6 - + sca: runs-on: ubuntu-latest name: SCA Test on Ubuntu/x86 steps: - uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - uses: thiagodnf/yaml-schema-checker@v0.0.10 @@ -86,11 +90,13 @@ jobs: .github/ISSUE_TEMPLATE/*.yml .github/ISSUE_TEMPLATE/*.yaml - name: Set up Go - uses: ./.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false - name: Prepare ENV run: | cd $GITHUB_WORKSPACE && make clean && make config && make build - make install-static-check-tools + make install-static-check-tools - name: Static Code Analysis run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/e2e-compose.yaml b/.github/workflows/e2e-compose.yaml index d2cfe37..f1f6c78 100644 --- a/.github/workflows/e2e-compose.yaml +++ b/.github/workflows/e2e-compose.yaml @@ -14,13 +14,13 @@ jobs: - name: checkout uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: Print run attempt run: echo "run attempt is ${{ github.run_attempt }}" - + - name: docker compose launch-multi-cn timeout-minutes: 10 run: | @@ -39,7 +39,7 @@ jobs: mkdir -p ${{ github.workspace }}/docker-compose-log docker-compose -f etc/launch-tae-compose/compose.yaml --profile launch-multi-cn up -d --build - + # wait for ready i=1 while [ $(mysql -h 127.0.0.1 -P 6001 -u dump -p111 --execute 'create database if not exists compose_test;use compose_test; create table if not exists compose_test_table(col1 int auto_increment primary key);show tables;' 2>&1 | tee /dev/stderr | grep 'compose_test_table' | wc -l) -lt 1 ]; do @@ -65,12 +65,8 @@ jobs: path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - architecture: x64 + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Start BVT Test id: bvt_on_pr_version @@ -81,7 +77,7 @@ jobs: sed -i 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml echo "=============================" - + ./run.sh -n -g -o -p $GITHUB_WORKSPACE/test/distributed/cases -s /test/distributed/resources -e pessimistic_transaction 2>&1 - name: export log @@ -109,7 +105,7 @@ jobs: with: name: Compose-multi-cn-e2e-bvt-test-docker-log(Optimistic,PUSH) path: | - ${{ github.workspace }}/docker-compose-log + ${{ github.workspace }}/docker-compose-log retention-days: 7 multi-CN-bvt-docker-compose-pessimistic: @@ -122,7 +118,7 @@ jobs: - name: checkout uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} @@ -137,7 +133,7 @@ jobs: cat ./etc/launch-tae-compose/config/tn.toml mkdir -p ${{ github.workspace }}/docker-compose-log docker-compose -f etc/launch-tae-compose/compose.yaml --profile launch-multi-cn up -d --build - + # wait for ready i=1 while [ $(mysql -h 127.0.0.1 -P 6001 -u dump -p111 --execute 'create database if not exists compose_test;use compose_test; create table if not exists compose_test_table(col1 int auto_increment primary key);show tables;' 2>&1 | tee /dev/stderr | grep 'compose_test_table' | wc -l) -lt 1 ]; do @@ -158,12 +154,8 @@ jobs: path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - architecture: x64 + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Start BVT Test id: bvt_on_pr_version diff --git a/.github/workflows/e2e-standalone.yaml b/.github/workflows/e2e-standalone.yaml index 1453631..7b03193 100644 --- a/.github/workflows/e2e-standalone.yaml +++ b/.github/workflows/e2e-standalone.yaml @@ -13,12 +13,12 @@ jobs: - name: checkout head uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" path: ./head repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - - name: Set up Go - uses: ./head/.github/actions/setup_env + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Build MatrixOne run: | cd $GITHUB_WORKSPACE/head && make clean && make build @@ -44,12 +44,6 @@ jobs: repository: matrixorigin/mo-tester path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - architecture: x64 - name: Start BVT Test id: bvt_on_pr_version run: | @@ -80,10 +74,10 @@ jobs: run: | cd $GITHUB_WORKSPACE/head mv mo-service.log mo-service.r1.log - + # delete for clear the start finish status of mo rm -rf mo-data/local/system_init_completed - + ./optools/run_bvt.sh $GITHUB_WORKSPACE/head launch - name: Start BVT Test for MO with Version of Head Restarted id: bvt_on_latest_head_version_run2 @@ -96,10 +90,10 @@ jobs: echo "=============================" ./run.sh -n -g -o -p $GITHUB_WORKSPACE/head/test/distributed/cases -e pessimistic_transaction 2>&1 - - name: Dump restarted mo-service goroutines + - name: Dump restarted mo-service goroutines if: ${{ always() && !cancelled() }} run: | - if [ "$(ps -ef | grep 'mo-service' | grep -v "grep" | wc -l)" -gt 0 ]; then curl http://localhost:12345/debug/pprof/goroutine\?debug=2 -o ${{ github.workspace }}/head/restarted-dump-stacks.log; pkill -9 mo-service; else echo 'current mo-service has already crashed'; exit 1; fi + if [ "$(ps -ef | grep 'mo-service' | grep -v "grep" | wc -l)" -gt 0 ]; then curl http://localhost:12345/debug/pprof/goroutine\?debug=2 -o ${{ github.workspace }}/head/restarted-dump-stacks.log; pkill -9 mo-service; else echo 'current mo-service has already crashed'; exit 1; fi - name: Check Log Messages Count per second if: ${{ always() && !cancelled() }} run: | @@ -138,8 +132,8 @@ jobs: path: ./head repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - - name: Set up Go - uses: ./head/.github/actions/setup_env + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Build MatrixOne run: | cd $GITHUB_WORKSPACE/head && make clean && make build @@ -159,11 +153,6 @@ jobs: repository: matrixorigin/mo-tester path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - name: Start BVT Test id: bvt_on_pr_version run: | @@ -214,13 +203,13 @@ jobs: - name: checkout head uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" path: ./head repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - - name: Set up Go - uses: ./head/.github/actions/setup_env + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Build MatrixOne run: | @@ -245,13 +234,6 @@ jobs: path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - architecture: x64 - - name: Start BVT Test id: bvt_on_pr_version run: | @@ -261,7 +243,7 @@ jobs: sed -i 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml echo "=============================" - + ./run.sh -n -g -o -p $GITHUB_WORKSPACE/head/test/distributed/cases -s $GITHUB_WORKSPACE/head/test/distributed/resources -e optimistic 2>&1 - name: Dump mo-service goroutines diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index e36041d..784f961 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -33,13 +33,13 @@ jobs: repository: ${{ github.event.pull_request.base.repo.full_name }} ref: ${{ github.event.pull_request.base.ref }} - - name: Set up Go - uses: ./upstream/.github/actions/setup_env + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Build MatrixOne for head run: | cd $GITHUB_WORKSPACE/head && make clean && make build - git rev-parse --short HEAD + git rev-parse --short HEAD - name: Build MatrixOne for upstream run: | @@ -48,7 +48,7 @@ jobs: - name: Create path for execution run: | - cd $GITHUB_WORKSPACE && mkdir workspace + cd $GITHUB_WORKSPACE && mkdir workspace - name: Start the MO of Target Branch run: | @@ -56,7 +56,7 @@ jobs: mv $GITHUB_WORKSPACE/upstream/etc . mv $GITHUB_WORKSPACE/upstream/mo-service . mv $GITHUB_WORKSPACE/upstream/optools . - + ./optools/run_bvt.sh $GITHUB_WORKSPACE/workspace launch sleep 60; @@ -67,12 +67,6 @@ jobs: path: ./mo-tester ref: main - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - - name: Start BVT Test for Target Branch id: bvt_on_latest_main_version run: | @@ -133,7 +127,7 @@ jobs: sed -i 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml echo "=============================" - + ./run.sh -n -g -o -p $GITHUB_WORKSPACE/head/test/distributed/cases -e optimistic 2>&1 - name: Dump mo-service-new goroutines @@ -185,7 +179,7 @@ jobs: path: ./head repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - + - name: Get latest release id: get-latest-release run: | @@ -195,23 +189,21 @@ jobs: https://api.github.com/repos/${{ inputs.release-repo }}/releases/latest | jq -r .tag_name)) echo "Latest release tag is $LATEST_RELEASE_TAG" echo "tag=$LATEST_RELEASE_TAG" >> $GITHUB_OUTPUT - + - name: Checkout Upstream Release uses: actions/checkout@v4 with: path: ./upstream repository: ${{ inputs.release-repo }} ref: ${{ steps.get-latest-release.outputs.tag }} - - - name: Set up Go - uses: ./upstream/.github/actions/setup_env - with: - go-version: "1.21.5" + + - name: Set up Go And Java + uses: matrixorigin/CI/actions/setup-env@main - name: Build MatrixOne for head run: | cd $GITHUB_WORKSPACE/head && make clean && make build - git rev-parse --short HEAD + git rev-parse --short HEAD - name: Build MatrixOne for upstream release run: | @@ -220,7 +212,7 @@ jobs: - name: Create path for execution run: | - cd $GITHUB_WORKSPACE && mkdir workspace + cd $GITHUB_WORKSPACE && mkdir workspace - name: Start the MO of Rlease ${{ inputs.release-version }} run: | @@ -228,7 +220,7 @@ jobs: mv $GITHUB_WORKSPACE/upstream/etc . mv $GITHUB_WORKSPACE/upstream/mo-service . mv $GITHUB_WORKSPACE/upstream/optools . - + ./optools/run_bvt.sh $GITHUB_WORKSPACE/workspace launch - name: Clone test-tool repository @@ -238,12 +230,6 @@ jobs: path: ./mo-tester ref: main - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - - name: Start BVT Test for Release ${{ inputs.release-version }} id: bvt_on_latest_main_version run: | @@ -307,7 +293,7 @@ jobs: sed -i 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml echo "=============================" - + ./run.sh -n -g -o -p $GITHUB_WORKSPACE/head/test/distributed/cases -e optimistic 2>&1 - name: Dump mo-service-new goroutines diff --git a/.github/workflows/merge-trigger-standalone.yaml b/.github/workflows/merge-trigger-standalone.yaml index d143d67..3f84501 100644 --- a/.github/workflows/merge-trigger-standalone.yaml +++ b/.github/workflows/merge-trigger-standalone.yaml @@ -1,13 +1,12 @@ -name: MO Checkin Regression(Standalone BVT) +name: MO Checkin Regression(Standalone BVT) on: workflow_call: secrets: WECHAT_MO_CHECKIN_BOT_WEBHOOK: - description: 'WECHAT_MO_CHECKIN_BOT_WEBHOOK' + description: "WECHAT_MO_CHECKIN_BOT_WEBHOOK" required: true - jobs: pessimistic-bvt-darwin-arm64: if: ${{ github.event.pull_request.merged == true }} @@ -22,7 +21,9 @@ jobs: with: path: ./matrixone - name: Set up Go - uses: ./matrixone/.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false - name: GO ENV run: go env @@ -43,7 +44,7 @@ jobs: export LC_ALL="zh_CN.UTF-8" export LANG="zh_CN.UTF-8" locale - + cd $GITHUB_WORKSPACE/matrixone ./optools/run_bvt.sh $GITHUB_WORKSPACE/matrixone launch @@ -63,7 +64,7 @@ jobs: export LC_ALL="zh_CN.UTF-8" export LANG="zh_CN.UTF-8" locale - + cd $GITHUB_WORKSPACE/mo-tester sed -i '' 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml @@ -121,18 +122,18 @@ jobs: with: path: ./head - name: Set up Go - uses: ./head/.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main with: - cache: "false" + setup-java: false - name: Build MatrixOne run: | export GOPROXY='https://goproxy.cn,direct' cd $GITHUB_WORKSPACE/head && make clean && make debug - git rev-parse --short HEAD + git rev-parse --short HEAD - name: Start MO run: | cd $GITHUB_WORKSPACE/head - ./optools/run_bvt.sh $GITHUB_WORKSPACE/head launch + ./optools/run_bvt.sh $GITHUB_WORKSPACE/head launch - name: Clone test-tool repository uses: actions/checkout@v4 with: @@ -141,7 +142,7 @@ jobs: ref: main - name: Set up JDK 8 for x64 run: echo "$JAVA_HOME/bin" >> $GITHUB_PATH - + - name: Start BVT Test id: bvt_on_pr_version run: | @@ -152,8 +153,8 @@ jobs: sed -i 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml echo "======================================" - - ./run.sh -n -g -o -p $GITHUB_WORKSPACE/head/test/distributed/cases -e optimistic,log/column,log/query,statement_query_type 2>&1 + + ./run.sh -n -g -o -p $GITHUB_WORKSPACE/head/test/distributed/cases -e optimistic,log/column,log/query,statement_query_type 2>&1 - name: Dump mo-service goroutines if: ${{ always() && !cancelled() }} run: | @@ -162,7 +163,7 @@ jobs: id: check_mo_status if: ${{ always() && !cancelled() }} run: | - if [ "$(ps -ef | grep 'mo-service' | grep -v "grep" | wc -l)" -gt 0 ]; then pkill -9 mo-service; else echo 'current mo-service has already crashed'; exit 1; fi + if [ "$(ps -ef | grep 'mo-service' | grep -v "grep" | wc -l)" -gt 0 ]; then pkill -9 mo-service; else echo 'current mo-service has already crashed'; exit 1; fi - name: generate upload files if: ${{ always() || cancelled() }} run: | @@ -171,12 +172,12 @@ jobs: rm -rf ./mo-tester/lib mv ${{ github.workspace }}/head/mo-service.log ${{ github.workspace }}/upload/ mv ${{ github.workspace }}/mo-tester ${{ github.workspace }}/upload/ - mv ${{ github.workspace }}/head/dump-stacks.log ${{ github.workspace }}/upload/ + mv ${{ github.workspace }}/head/dump-stacks.log ${{ github.workspace }}/upload/ - name: check data race if: ${{ always() || cancelled() }} run: | cat ${{ github.workspace }}/upload/mo-service.log | grep -C2 'DATA RACE' || true - if [ "$(cat ${{ github.workspace }}/upload/mo-service.log |grep 'DATA RACE' | grep -v "grep" | wc -l)" -gt 0 ]; then exit 1; fi + if [ "$(cat ${{ github.workspace }}/upload/mo-service.log |grep 'DATA RACE' | grep -v "grep" | wc -l)" -gt 0 ]; then exit 1; fi - uses: actions/upload-artifact@v4 if: ${{ always() || cancelled() }} with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8df0448..3f0e3cb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,22 +4,21 @@ on: workflow_call: secrets: TOKEN_ACTION: - description: 'TOKEN_ACTION' + description: "TOKEN_ACTION" required: true APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: - description: 'APPLE_DEVELOPER_CERTIFICATE_P12_BASE64' + description: "APPLE_DEVELOPER_CERTIFICATE_P12_BASE64" required: true APPLE_DEVELOPER_CERTIFICATE_PASSWORD: - description: 'APPLE_DEVELOPER_CERTIFICATE_PASSWORD' + description: "APPLE_DEVELOPER_CERTIFICATE_PASSWORD" required: true AC_PASSWORD: - description: 'AC_PASSWORD' + description: "AC_PASSWORD" required: true AC_PROVIDER: - description: 'AC_PROVIDER' + description: "AC_PROVIDER" required: true - jobs: linux-amd64-build-job: runs-on: ubuntu-20.04 @@ -36,7 +35,9 @@ jobs: echo ${{ steps.get_release.outputs.upload_url }} echo ${{ steps.get_release.outputs.tag_name }} - name: Set up Go - uses: ./.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false - name: Build normal run: | make build @@ -64,7 +65,7 @@ jobs: asset_path: ./mo-${{ steps.get_release.outputs.tag_name }}-linux-x86_64.zip asset_name: mo-${{ steps.get_release.outputs.tag_name }}-linux-x86_64.zip asset_content_type: application/zip - + linux-arm64-build-job: runs-on: aws-arm64-runner steps: @@ -74,19 +75,19 @@ jobs: id: get_release uses: bruceadams/get-release@v1.3.2 env: - GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} + GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} - name: Echo some info run: | echo ${{ steps.get_release.outputs.upload_url }} echo ${{ steps.get_release.outputs.tag_name }} - name: Set up Go - uses: ./.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main with: - cache: false + setup-java: false - name: Build normal run: | make build - + mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-linux-arm64/etc mv mo-service mo-${{ steps.get_release.outputs.tag_name }}-linux-arm64/ @@ -116,7 +117,7 @@ jobs: darwin-x86-build-job: runs-on: macos-latest steps: - # GitHub Hosted MacOS runner cannot connect to time.apple.com, so use time.windows.com + # GitHub Hosted MacOS runner cannot connect to time.apple.com, so use time.windows.com - name: Sync System Time run: | set +e; @@ -139,7 +140,9 @@ jobs: echo ${{ steps.get_release.outputs.upload_url }} echo ${{ steps.get_release.outputs.tag_name }} - name: Set up Go - uses: ./.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main + with: + setup-java: false - name: Build normal run: | make build @@ -154,7 +157,7 @@ jobs: - name: Clone gon uses: actions/checkout@v4 with: - fetch-depth: '1' + fetch-depth: "1" repository: matrixorigin/gon ref: master path: ./gon @@ -178,11 +181,11 @@ jobs: cd ./mo-macos11 spctl -a -vvv -t install mo-service codesign --test-requirement="=notarized" -vv mo-service - + # rename filepath cd .. && mv ./mo-macos11 mo-${{ steps.get_release.outputs.tag_name }}-darwin-x86_64 mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-darwin-x86_64/etc - + # copy toml configure file mv etc/launch mo-${{ steps.get_release.outputs.tag_name }}-darwin-x86_64/etc/ if [ -d "./etc/launch-with-python-udf-server" ]; then @@ -265,7 +268,7 @@ jobs: # rename filepath cd .. && mv ./mo-macos11 mo-${{ steps.get_release.outputs.tag_name }}-darwin-arm64 mkdir -p mo-${{ steps.get_release.outputs.tag_name }}-darwin-arm64/etc - + # copy toml configure file mv etc/launch mo-${{ steps.get_release.outputs.tag_name }}-darwin-arm64/etc if [ -d "./etc/launch-with-python-udf-server" ]; then diff --git a/.github/workflows/robot.yaml b/.github/workflows/robot.yaml index 2188493..c662b88 100644 --- a/.github/workflows/robot.yaml +++ b/.github/workflows/robot.yaml @@ -5,22 +5,22 @@ on: workflow_call: secrets: TOKEN_ACTION: - description: 'TOKEN_ACTION' + description: "TOKEN_ACTION" required: true WECHAT_WORK_BOT_WEBHOOK: - description: 'WECHAT_WORK_BOT_WEBHOOK' - required: true + description: "WECHAT_WORK_BOT_WEBHOOK" + required: true DOCU_GROUP_HOOK: - description: 'DOCU_GROUP_HOOK' + description: "DOCU_GROUP_HOOK" required: true - + # A workflow run is made up of one or more jobs that can run sequentially or in parallel. jobs: issue-notify: - if : github.event_name == 'issues' && github.event.action == 'assigned' + if: github.event_name == 'issues' && github.event.action == 'assigned' runs-on: ubuntu-latest steps: - - name : ISSUE Triggered + - name: ISSUE Triggered uses: chf007/action-wechat-work@master env: WECHAT_WORK_BOT_WEBHOOK: ${{secrets.WECHAT_WORK_BOT_WEBHOOK}} @@ -63,7 +63,7 @@ jobs: if: ${{ steps.get_check_val.outputs.check_val == 'True' }} uses: actions-cool/issues-helper@v3 with: - actions: 'open-issue' + actions: "open-issue" token: ${{ secrets.TOKEN_ACTION }} issue-number: ${{ github.event.issue.number }} @@ -71,7 +71,7 @@ jobs: if: ${{ steps.get_check_val.outputs.check_val == 'True' }} uses: actions-cool/issues-helper@v3 with: - actions: 'create-comment' + actions: "create-comment" token: ${{ secrets.TOKEN_ACTION }} issue-number: ${{ github.event.issue.number }} body: | @@ -85,10 +85,10 @@ jobs: if: github.event.issue.user.login != github.event.sender.login && github.event.action == 'closed' && github.event.sender.login != 'sukki37' && github.event.sender.login != 'aressu1985' && github.event.sender.login != 'fengttt' && github.event.sender.login != 'florashi181' uses: actions-cool/issues-helper@v3 with: - actions: 'open-issue' + actions: "open-issue" token: ${{ secrets.TOKEN_ACTION }} issue-number: ${{ github.event.issue.number }} - + issue_close_check: runs-on: ubuntu-latest if: github.event_name == 'issues' && github.event.action == 'closed' @@ -106,12 +106,10 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" path: ./matrixone - name: Set up Go - uses: ./matrixone/.github/actions/setup_env - with: - cache: false + uses: matrixorigin/CI/actions/setup-env@main - name: Set Variables run: | echo "ut_report='UT-Report.out'" >> $GITHUB_ENV @@ -129,11 +127,6 @@ jobs: repository: matrixorigin/mo-tester path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - name: Start Unit Test timeout-minutes: 120 run: | @@ -165,7 +158,7 @@ jobs: sed -i 's/ port: [0-9]*/ port: 12345/g' mo.yml cat mo.yml echo "============================" - + ./run.sh -n -g -o -p $GITHUB_WORKSPACE/matrixone/test/distributed/cases -e optimistic 2>&1 - name: Generate UT and BVT Coverage File if: ${{ always() && !cancelled() }} @@ -184,7 +177,7 @@ jobs: cat ${{ env.raw_bvt_coverage }} | grep -v ${{ env.bvt_excluded_pkg }} > ${{ env.bvt_coverage }} echo "bvt_coverage finished" go tool cover -o ${{ env.bvt_html_coverage }} -html=${{ env.bvt_coverage }} - echo "bvt_html_coverage finished" + echo "bvt_html_coverage finished" - name: Coverage Calculate if: ${{ always() && !cancelled() }} run: | @@ -225,7 +218,7 @@ jobs: done cat bvt_tmp.txt | sort -k 1 -k 2n >> coverage_report.txt # zip -r code_quality_reports.zip ${{ env.bvt_html_coverage }} ${{ env.ut_html_coverage }} coverage_report.txt lint.out UT-Report.out - zip -r code_quality_reports.zip ${{ env.bvt_html_coverage }} ${{ env.ut_html_coverage }} coverage_report.txt UT-Report.out $GITHUB_WORKSPACE/matrixone/mo-service.log + zip -r code_quality_reports.zip ${{ env.bvt_html_coverage }} ${{ env.ut_html_coverage }} coverage_report.txt UT-Report.out $GITHUB_WORKSPACE/matrixone/mo-service.log - name: Generate Notice Content if: ${{ always() && !cancelled() }} run: | @@ -235,7 +228,7 @@ jobs: echo "Url=${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV echo 'Detail<> $GITHUB_ENV cat coverage_report.txt >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV - uses: actions/upload-artifact@v4 if: ${{ always() && !cancelled() }} continue-on-error: true diff --git a/.github/workflows/utils.yaml b/.github/workflows/utils.yaml index 9aa569d..2b20aec 100644 --- a/.github/workflows/utils.yaml +++ b/.github/workflows/utils.yaml @@ -5,28 +5,28 @@ on: workflow_call: secrets: TOKEN_ACTION: - description: 'A token passed from the caller workflow' + description: "A token passed from the caller workflow" required: true S3ENDPOINT: - description: 'S3ENDPOINT For Test' + description: "S3ENDPOINT For Test" required: true S3REGION: - description: 'S3REGION For Test' + description: "S3REGION For Test" required: true S3APIKEY: - description: 'S3APIKEY For Test' + description: "S3APIKEY For Test" required: true S3APISECRET: - description: 'S3APISECRET For Test' + description: "S3APISECRET For Test" required: true S3BUCKET: - description: 'S3BUCKET For Test' + description: "S3BUCKET For Test" required: true DOCU_GROUP_HOOK: - description: 'DOCU_GROUP_HOOK For Notice' + description: "DOCU_GROUP_HOOK For Notice" required: true OPENAI_API_KEY: - description: 'OPENAI_API_KEY For get PR Suggestion' + description: "OPENAI_API_KEY For get PR Suggestion" required: true jobs: @@ -36,44 +36,44 @@ jobs: in_org: ${{ steps.check_in_org.outputs.in_org }} safe_label: ${{ steps.check_safe_label.outputs.safe_label }} steps: - - id: check_in_org - name: CHECK ORGANIZATION USER - run: | - PAGE=1; - PER_PAGE=100; - USER_IN_ORG="0"; - while true; do - users=$(curl -L \ + - id: check_in_org + name: CHECK ORGANIZATION USER + run: | + PAGE=1; + PER_PAGE=100; + USER_IN_ORG="0"; + while true; do + users=$(curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.TOKEN_ACTION }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/orgs/matrixorigin/members?page=$PAGE&per_page=$PER_PAGE"); + if [ $(echo $users | jq ".[].login" | grep -c "${{ github.event.pull_request.user.login }}" ) -eq 1 ]; then + USER_IN_ORG="1"; + break; + fi + if [ $(echo $users | jq ".[].login" | wc -l ) -eq $PER_PAGE ]; then + PAGE=$(($PAGE+1)); + users=""; + else + break; + fi + done + echo "in_org=$USER_IN_ORG" >> $GITHUB_OUTPUT; + + - id: check_safe_label + name: CHECK PULL REQUEST LABEL + run: | + labels=$(curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.TOKEN_ACTION }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/orgs/matrixorigin/members?page=$PAGE&per_page=$PER_PAGE"); - if [ $(echo $users | jq ".[].login" | grep -c "${{ github.event.pull_request.user.login }}" ) -eq 1 ]; then - USER_IN_ORG="1"; - break; - fi - if [ $(echo $users | jq ".[].login" | wc -l ) -eq $PER_PAGE ]; then - PAGE=$(($PAGE+1)); - users=""; + '${{ github.event.pull_request.url}}' | jq ".labels"); + if [ $(echo $labels | jq ".[].name" | grep -c "safe-to-test" ) -ge 1 ]; then + echo "safe_label=1" >> $GITHUB_OUTPUT; else - break; + echo "safe_label=0" >> $GITHUB_OUTPUT; fi - done - echo "in_org=$USER_IN_ORG" >> $GITHUB_OUTPUT; - - - id: check_safe_label - name: CHECK PULL REQUEST LABEL - run: | - labels=$(curl -L \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.TOKEN_ACTION }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - '${{ github.event.pull_request.url}}' | jq ".labels"); - if [ $(echo $labels | jq ".[].name" | grep -c "safe-to-test" ) -ge 1 ]; then - echo "safe_label=1" >> $GITHUB_OUTPUT; - else - echo "safe_label=0" >> $GITHUB_OUTPUT; - fi ut_coverage: if: ${{ needs.check_organization_user.outputs.safe_label == '1' || needs.check_organization_user.outputs.in_org == '1' }} @@ -83,12 +83,12 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: '3' + fetch-depth: "3" path: ./matrixone repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: Set up Go - uses: ./matrixone/.github/actions/setup_env + uses: matrixorigin/CI/actions/setup-env@main - name: Set Variables run: | cd $GITHUB_WORKSPACE/matrixone @@ -138,13 +138,6 @@ jobs: repository: matrixorigin/mo-tester path: ./mo-tester ref: main - - name: Set up JDK 8 for x64 - if: ${{ steps.ut-pr.outputs.paths != '' }} - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - architecture: x64 - name: Start BVT Test Service if: ${{ steps.ut-pr.outputs.paths != '' }} id: test_bvt_start @@ -211,7 +204,7 @@ jobs: path: | ${{ github.workspace }}/matrixone/code_coverage_reports_${{ github.event.pull_request.number}}_${{ github.run_id }}.zip retention-days: 7 - + pr-size-label: runs-on: ubuntu-latest needs: [check_organization_user] @@ -243,20 +236,20 @@ jobs: name_label: "doc influence" reviewers: "lacrimosaprinz,dengn" mentions: "Prinz,DengNan" - + chatgpt-review: name: ChatGPT Review needs: [check_organization_user] runs-on: ubuntu-latest if: ${{ github.event.action == 'opened' }} steps: - - uses: matrixorigin/ChatGPT-Reviewer@main - name: ChatGPT Review - env: - GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - with: - model: "gpt-3.5-turbo" - temperature: 0.2 - review_per_file: false - comment_per_file: false + - uses: matrixorigin/ChatGPT-Reviewer@main + name: ChatGPT Review + env: + GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + with: + model: "gpt-3.5-turbo" + temperature: 0.2 + review_per_file: false + comment_per_file: false