-
Notifications
You must be signed in to change notification settings - Fork 116
chore(ci): replace hardcoded server commit with latest release #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c6ef656
0cceca1
b9ac8f5
e39577e
e043aa1
77a10ac
e3146a1
aa29128
0871406
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: 'Get HugeGraph stable commit id' | ||
| description: 'Fetch the latest HugeGraph release commit SHA and expose it as output and env variable' | ||
|
|
||
| outputs: | ||
| commit_id: | ||
| description: 'The commit SHA of the latest HugeGraph release' | ||
| value: ${{ steps.get-commit.outputs.commit_id }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Get HugeGraph stable commit id | ||
| id: get-commit | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const owner = 'apache'; | ||
| const repo = 'hugegraph'; | ||
| try { | ||
| const { data: release } = await github.rest.repos.getLatestRelease({ owner, repo }); | ||
| const tagName = release.tag_name; | ||
| const { data: ref } = await github.rest.git.getRef({ | ||
| owner, repo, ref: `tags/${tagName}` | ||
| }); | ||
| let sha = ref.object.sha; | ||
| if (ref.object.type === 'tag') { | ||
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } else if (ref.object.type !== 'commit') { | ||
| throw new Error(`Unexpected ref type: ${ref.object.type}`); | ||
| } | ||
| core.exportVariable('COMMIT_ID', sha); | ||
| core.setOutput('commit_id', sha); | ||
| console.log(`Using HugeGraph release ${tagName} (${sha})`); | ||
| } catch (error) { | ||
| core.setFailed(`Failed to get HugeGraph commit: ${error.message}`); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: 'Setup HugeGraph Server' | ||
| description: 'Prepare environment and install HugeGraph server from source' | ||
|
|
||
| inputs: | ||
| travis-dir: | ||
| description: 'Path to the Travis assembly directory containing install scripts' | ||
| required: true | ||
| commit-id: | ||
| description: 'HugeGraph commit SHA to install' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Prepare env and service | ||
| shell: bash | ||
| run: | | ||
| ${{ inputs.travis-dir }}/install-hugegraph-from-source.sh ${{ inputs.commit-id }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: 'Setup Java and Maven Environment' | ||
| description: 'Install JDK, cache Maven packages, and optionally apply staged Maven repository settings' | ||
|
|
||
| inputs: | ||
| java-version: | ||
| description: 'Java version to install' | ||
| required: false | ||
| default: '11' | ||
| distribution: | ||
| description: 'JDK distribution' | ||
| required: false | ||
| default: 'zulu' | ||
| use-stage: | ||
| description: 'Whether to apply staged Maven repository settings' | ||
| required: false | ||
| default: 'true' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install JDK ${{ inputs.java-version }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ inputs.java-version }} | ||
| distribution: ${{ inputs.distribution }} | ||
| cache: 'maven' | ||
|
|
||
| - name: Use staged maven repo settings | ||
| if: ${{ inputs.use-stage == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| cp $HOME/.m2/settings.xml /tmp/settings.xml | ||
| mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: 'Upload Coverage to Codecov' | ||
| description: 'Upload test coverage report to Codecov' | ||
|
|
||
| inputs: | ||
| token: | ||
| description: 'Codecov upload token' | ||
| required: true | ||
| file: | ||
| description: 'Path to the coverage report file' | ||
| required: false | ||
| default: 'target/jacoco.xml' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| token: ${{ inputs.token }} | ||
| file: ${{ inputs.file }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,9 +23,6 @@ on: | |
|
|
||
| env: | ||
| TRAVIS_DIR: hugegraph-hubble/hubble-dist/assembly/travis | ||
| # TODO: replace it with the (latest - n) commit id (n >= 15) | ||
| # FIXME: hugegraph commit date: 2025-10-30 | ||
| COMMIT_ID: 8c1ee71 # 5b3d295 | ||
|
|
||
| jobs: | ||
| hubble-ci: | ||
|
|
@@ -44,42 +41,33 @@ jobs: | |
| with: | ||
| fetch-depth: 2 | ||
|
|
||
| - name: Install JDK 11 | ||
| uses: actions/setup-java@v3 | ||
| - name: Get HugeGraph stable commit id | ||
| id: get-commit | ||
| uses: ./.github/actions/get-hugegraph-commit | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The $TRAVIS_DIR/install-hugegraph.sh $COMMIT_ID
- name: Prepare env and service
env:
COMMIT_ID: ${{ steps.get-commit.outputs.commit_id }}
run: |
...
$TRAVIS_DIR/install-hugegraph.sh $COMMIT_ID |
||
|
|
||
| - name: Setup Java environment | ||
| uses: ./.github/actions/setup-java-env | ||
| with: | ||
| java-version: ${{ matrix.JAVA_VERSION }} | ||
| distribution: 'adopt' | ||
| use-stage: ${{ env.USE_STAGE }} | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
|
|
||
| # we also should cache python & yarn & downloads to avoid useless work | ||
| - name: Cache Maven packages | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ~/.m2/repository | ||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-maven- | ||
|
|
||
| - 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: Compile | ||
| run: | | ||
| mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp | ||
| cd hugegraph-hubble && ls * | ||
| mvn -e compile -Dmaven.javadoc.skip=true -ntp | ||
|
|
||
| - name: Prepare env and service | ||
| env: | ||
| COMMIT_ID: ${{ steps.get-commit.outputs.commit_id }} | ||
| run: | | ||
|
|
||
| python -m pip install -r ${TRAVIS_DIR}/requirements.txt | ||
| cd hugegraph-hubble | ||
| mvn package -Dmaven.test.skip=true | ||
|
|
@@ -102,7 +90,7 @@ jobs: | |
| hubble-dist/assembly/travis/run-api-test.sh | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
| uses: ./.github/actions/upload-coverage | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: target/site/jacoco/*.xml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,6 @@ jobs: | |
| USE_STAGE: 'true' # Whether to include the stage repository. | ||
| TRAVIS_DIR: hugegraph-loader/assembly/travis | ||
| STATIC_DIR: hugegraph-loader/assembly/static | ||
| # TODO: replace it with the (latest - n) commit id (n >= 15) | ||
| # hugegraph commit date: 2025-10-30 | ||
| COMMIT_ID: 5b3d295 | ||
| DB_USER: root | ||
| DB_PASS: root | ||
| DB_DATABASE: load_test | ||
|
|
@@ -50,18 +47,16 @@ jobs: | |
| with: | ||
| fetch-depth: 2 | ||
|
|
||
| - name: Install JDK 11 | ||
| uses: actions/setup-java@v4 | ||
| - name: Get HugeGraph stable commit id | ||
| id: get-commit | ||
| uses: ./.github/actions/get-hugegraph-commit | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID
All other workflows in this PR pass the SHA explicitly via - name: Prepare env and service
env:
COMMIT_ID: ${{ steps.get-commit.outputs.commit_id }}
run: |
$TRAVIS_DIR/install-hadoop.sh
$TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID |
||
|
|
||
| - name: Setup Java environment | ||
| uses: ./.github/actions/setup-java-env | ||
| with: | ||
| java-version: ${{ matrix.JAVA_VERSION }} | ||
| distribution: 'adopt' | ||
|
|
||
| - name: Cache Maven packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.m2 | ||
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: ${{ runner.os }}-m2 | ||
| use-stage: ${{ env.USE_STAGE }} | ||
|
|
||
| - name: Cache Hadoop | ||
| uses: actions/cache@v4 | ||
|
|
@@ -72,20 +67,16 @@ jobs: | |
| - name: Cache HugeGraph Server | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/hugegraph-cache-${{ env.COMMIT_ID }} | ||
| key: ${{ runner.os }}-hugegraph-server-${{ env.COMMIT_ID }} | ||
|
|
||
| - 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 | ||
| path: ~/hugegraph-cache-${{ steps.get-commit.outputs.commit_id }} | ||
| key: ${{ runner.os }}-hugegraph-server-${{ steps.get-commit.outputs.commit_id }} | ||
|
|
||
| - name: Compile | ||
| run: | | ||
| mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp | ||
|
|
||
| - name: Prepare env and service | ||
| env: | ||
| COMMIT_ID: ${{ steps.get-commit.outputs.commit_id }} | ||
| run: | | ||
| $TRAVIS_DIR/install-hadoop.sh | ||
| $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID | ||
|
|
@@ -100,7 +91,7 @@ jobs: | |
| mvn test -P kafka | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| uses: ./.github/actions/upload-coverage | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: target/jacoco.xml | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/setup-java@v4withcache: 'maven'already saves/restores~/.m2/repositoryinternally using asetup-java-namespaced key. The explicitCache Maven packagesstep below (lines 28-33) targets the same directory with a different key, so every job saves two separate cache entries for identical content.For workflows that previously had only one cache mechanism (
tools-ci,spark-connector-ci,client-go-ci,loader-ci), this PR silently doubles the cache storage and upload time.Remove either:
cache: 'maven'line here, keeping the explicit step below, OR- name: Cache Maven packagesblock (lines 28-33), relying solely onsetup-java's built-in caching.Both approaches work; the latter is less YAML and the recommended pattern for
setup-java@v4.