From ad235e6c87bb6563c574665930aa3d777274ae79 Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Sun, 8 Jun 2025 22:29:02 +0800 Subject: [PATCH 1/7] refactor(ci): merge hstore with server --- .github/workflows/pd-store-ci.yml | 72 +------------------------------ .github/workflows/server-ci.yml | 17 +++++--- 2 files changed, 12 insertions(+), 77 deletions(-) diff --git a/.github/workflows/pd-store-ci.yml b/.github/workflows/pd-store-ci.yml index 6915e22eb2..e638ff8e10 100644 --- a/.github/workflows/pd-store-ci.yml +++ b/.github/workflows/pd-store-ci.yml @@ -1,4 +1,4 @@ -name: "HugeGraph-PD & Store & Hstore CI" +name: "HugeGraph-PD & Store CI" on: push: @@ -146,73 +146,3 @@ jobs: uses: codecov/codecov-action@v3.0.0 with: file: ${{ env.REPORT_DIR }}/*.xml - - hstore: - # TODO: avoid duplicated env setup - runs-on: ubuntu-latest - env: - USE_STAGE: 'false' # Whether to include the stage repository. - TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis - REPORT_DIR: target/site/jacoco - BACKEND: hstore - RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') || startsWith(github.base_ref, 'release-') }} - - steps: - - name: Install JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'zulu' - - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: use staged maven repo settings - if: ${{ env.USE_STAGE == 'true' }} - run: | - cp $HOME/.m2/settings.xml /tmp/settings.xml - mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml - - - name: Package - run: | - mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp - - - name: Prepare env and service - run: | - $TRAVIS_DIR/install-backend.sh $BACKEND - - - name: Run unit test - run: | - $TRAVIS_DIR/run-unit-test.sh $BACKEND - - - name: Run core test - run: | - $TRAVIS_DIR/run-core-test.sh $BACKEND - - - name: Run api test - run: | - $TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR - - - name: Run raft test - if: ${{ env.BACKEND == 'rocksdb' }} - run: | - $TRAVIS_DIR/run-api-test-for-raft.sh $BACKEND $REPORT_DIR - - - name: Run TinkerPop test - if: ${{ env.RELEASE_BRANCH == 'true' }} - run: | - $TRAVIS_DIR/run-tinkerpop-test.sh $BACKEND tinkerpop - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3.0.0 - with: - file: ${{ env.REPORT_DIR }}/*.xml diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index f91bd809a3..9dc0f645ad 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -21,13 +21,13 @@ jobs: HEAD_BRANCH_NAME: ${{ github.head_ref }} BASE_BRANCH_NAME: ${{ github.base_ref }} TARGET_BRANCH_NAME: ${{ github.base_ref != '' && github.base_ref || github.ref_name }} - RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') }} + RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') || startsWith(github.base_ref, 'release-') }} RAFT_MODE: ${{ startsWith(github.head_ref, 'test') || startsWith(github.head_ref, 'raft') }} strategy: fail-fast: false matrix: - BACKEND: [ memory, rocksdb, hbase ] + BACKEND: [ memory, rocksdb, hbase, hstore ] JAVA_VERSION: [ '11' ] steps: @@ -43,10 +43,6 @@ jobs: java-version: '8' distribution: 'zulu' - - name: Prepare backend environment - run: | - $TRAVIS_DIR/install-backend.sh $BACKEND && jps -l - - name: Install Java ${{ matrix.JAVA_VERSION }} uses: actions/setup-java@v4 with: @@ -66,6 +62,15 @@ jobs: cp $HOME/.m2/settings.xml /tmp/settings.xml cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml + - name: Package (for hstore) + if: ${{ matrix.BACKEND == 'hstore' }} + run: | + mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp + + - name: Prepare backend environment + run: | + $TRAVIS_DIR/install-backend.sh $BACKEND && jps -l + - name: Compile run: | mvn clean compile -U -Dmaven.javadoc.skip=true -ntp From 687b24828eceb47d398963c366667c836e10a27d Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Mon, 9 Jun 2025 10:14:59 +0800 Subject: [PATCH 2/7] refactor(ci): merge hstore with server --- .github/workflows/server-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 9dc0f645ad..cc97c21298 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -62,6 +62,10 @@ jobs: cp $HOME/.m2/settings.xml /tmp/settings.xml cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml + - name: Compile + run: | + mvn clean compile -U -Dmaven.javadoc.skip=true -ntp + - name: Package (for hstore) if: ${{ matrix.BACKEND == 'hstore' }} run: | @@ -71,10 +75,6 @@ jobs: run: | $TRAVIS_DIR/install-backend.sh $BACKEND && jps -l - - name: Compile - run: | - mvn clean compile -U -Dmaven.javadoc.skip=true -ntp - - name: Run unit test run: | $TRAVIS_DIR/run-unit-test.sh $BACKEND From 76549adfa286c395a664dce761136be9cb0f5f59 Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Mon, 9 Jun 2025 15:34:55 +0800 Subject: [PATCH 3/7] refactor(ci): avoid repeated compilation --- .github/workflows/server-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index cc97c21298..cc673b1abf 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -69,7 +69,7 @@ jobs: - name: Package (for hstore) if: ${{ matrix.BACKEND == 'hstore' }} run: | - mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp + mvn package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp - name: Prepare backend environment run: | From dac88a8db324ceebde2fef3a5fa94636dc9359e9 Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Tue, 10 Jun 2025 15:02:14 +0800 Subject: [PATCH 4/7] refactor(ci): add prepare-backend.sh for prepare backend unique environment --- .github/scripts/prepare-backend.sh | 13 +++++++++++++ .github/workflows/server-ci.yml | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .github/scripts/prepare-backend.sh diff --git a/.github/scripts/prepare-backend.sh b/.github/scripts/prepare-backend.sh new file mode 100644 index 0000000000..174e0edc98 --- /dev/null +++ b/.github/scripts/prepare-backend.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +BACKEND=$1 + +echo "Preparing backend ci environment for $BACKEND..." + +if [[ "$BACKEND" == "hstore" ]]; then + mvn package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp +fi + +$TRAVIS_DIR/install-backend.sh $BACKEND +jps -l diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index cc673b1abf..af22461584 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -71,9 +71,9 @@ jobs: run: | mvn package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp - - name: Prepare backend environment + - name: Prepare backend unique environment run: | - $TRAVIS_DIR/install-backend.sh $BACKEND && jps -l + bash ../scripts/prepare-backend.sh $BACKEND - name: Run unit test run: | @@ -105,3 +105,4 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} file: ${{ env.REPORT_DIR }}/*.xml + From 38a9abd1b75a192903e3cb5d1351b64a32305986 Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Tue, 10 Jun 2025 15:06:42 +0800 Subject: [PATCH 5/7] refactor(ci): fix path --- .github/workflows/server-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index af22461584..5e574bc201 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -73,7 +73,7 @@ jobs: - name: Prepare backend unique environment run: | - bash ../scripts/prepare-backend.sh $BACKEND + bash .github/scripts/prepare-backend.sh $BACKEND - name: Run unit test run: | @@ -106,3 +106,4 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} file: ${{ env.REPORT_DIR }}/*.xml + From 584d15102fa0072429dca36ee8c10f5f5df7b01b Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Tue, 10 Jun 2025 15:10:00 +0800 Subject: [PATCH 6/7] refactor(ci): fix repeated step --- .github/workflows/server-ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 5e574bc201..33a4d2409c 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -66,11 +66,6 @@ jobs: run: | mvn clean compile -U -Dmaven.javadoc.skip=true -ntp - - name: Package (for hstore) - if: ${{ matrix.BACKEND == 'hstore' }} - run: | - mvn package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp - - name: Prepare backend unique environment run: | bash .github/scripts/prepare-backend.sh $BACKEND From f7db28f2a4eaaf13ca26d20436b56320b42f65e0 Mon Sep 17 00:00:00 2001 From: Tsukilc <3168078770@qq.com> Date: Tue, 10 Jun 2025 15:37:40 +0800 Subject: [PATCH 7/7] format --- .github/scripts/prepare-backend.sh | 6 ++++++ .github/workflows/server-ci.yml | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/prepare-backend.sh b/.github/scripts/prepare-backend.sh index 174e0edc98..e5724ace9d 100644 --- a/.github/scripts/prepare-backend.sh +++ b/.github/scripts/prepare-backend.sh @@ -1,4 +1,10 @@ #!/bin/bash +# This script prepares the backend CI environment based on the specified backend type. +# It handles special build requirements for specific backends before invoking the +# standard installation script. +# +# Usage: prepare-backend.sh +# where is one of: memory, rocksdb, hbase, hstore, etc. set -e BACKEND=$1 diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 33a4d2409c..699d56fb73 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -100,5 +100,3 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} file: ${{ env.REPORT_DIR }}/*.xml - -