This is an automated email from the ASF dual-hosted git repository.
kerwin612 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new e57d617db9 ci: reduce repeated setup and nightly rebuild work (#4119)
e57d617db9 is described below
commit e57d617db9ec74bfdf7eb5490478232feae47e61
Author: aias00 <[email protected]>
AuthorDate: Thu Apr 16 18:27:57 2026 +0800
ci: reduce repeated setup and nightly rebuild work (#4119)
---
.github/workflows/backend-build-test.yml | 55 ++++++++++++++++++++++----
.github/workflows/doc-build-test.yml | 9 +++++
.github/workflows/doc-deploy.yml | 6 +++
.github/workflows/frontend-build-test.yml | 9 +++++
.github/workflows/license-checker.yml | 4 ++
.github/workflows/monitor-e2e-test.yml | 13 +++---
.github/workflows/nightly-build.yml | 14 +++++--
script/ci/github-actions/setup-deps/action.yml | 26 +++++++++++-
8 files changed, 118 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/backend-build-test.yml
b/.github/workflows/backend-build-test.yml
index 0f73c6c61a..8dd73cd3f7 100644
--- a/.github/workflows/backend-build-test.yml
+++ b/.github/workflows/backend-build-test.yml
@@ -38,6 +38,10 @@ on:
- 'script/**'
- 'material/**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: true
+
jobs:
backend-build:
runs-on: ubuntu-latest
@@ -46,7 +50,7 @@ jobs:
- uses: ./script/ci/github-actions/setup-deps
- name: Build with Maven
- run: mvnd clean -B package -Prelease -Dmaven.test.skip=false --file
pom.xml
+ run: mvnd clean -B package -pl '!hertzbeat-e2e' -Prelease
-Dmaven.test.skip=false --file pom.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
@@ -55,6 +59,47 @@ jobs:
fail_ci_if_error: false
verbose: true
+ - name: Upload backend distribution
+ uses: actions/upload-artifact@v4
+ with:
+ name: backend-dist-${{ github.run_id }}
+ path: dist/
+ retention-days: 1
+ compression-level: 0
+
+ backend-maven-e2e:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ./script/ci/github-actions/setup-deps
+
+ - name: Build backend Maven E2E modules
+ run: |
+ mvnd clean -B package \
+ -pl
hertzbeat-e2e/hertzbeat-collector-common-e2e,hertzbeat-e2e/hertzbeat-collector-kafka-e2e,hertzbeat-e2e/hertzbeat-collector-basic-e2e,hertzbeat-e2e/hertzbeat-collector-mysql-r2dbc-e2e,hertzbeat-e2e/hertzbeat-log-e2e
\
+ -am \
+ -Dmaven.test.skip=false \
+ --file pom.xml
+
+ - name: Upload Maven E2E coverage reports to Codecov
+ uses: codecov/[email protected]
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ fail_ci_if_error: false
+ verbose: true
+
+ backend-image-e2e:
+ needs: backend-build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Download backend distribution
+ uses: actions/download-artifact@v4
+ with:
+ name: backend-dist-${{ github.run_id }}
+ path: dist/
+
- name: Build Image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
@@ -65,12 +110,9 @@ jobs:
- name: Run E2E
run: |
- sudo curl -L
https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64
-o /usr/local/bin/docker-compose
- sudo chmod u+x /usr/local/bin/docker-compose
-
cd e2e
- sudo docker-compose version
- sudo docker-compose up --exit-code-from testing --remove-orphans
+ docker compose version
+ docker compose up --exit-code-from testing --remove-orphans
# upload application logs
- name: Upload logs & API test reports
@@ -81,4 +123,3 @@ jobs:
path: |
e2e/logs/
e2e/report/
-
diff --git a/.github/workflows/doc-build-test.yml
b/.github/workflows/doc-build-test.yml
index 63e5f12a4d..b1a417d07c 100644
--- a/.github/workflows/doc-build-test.yml
+++ b/.github/workflows/doc-build-test.yml
@@ -27,6 +27,10 @@ on:
paths:
- 'home/**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: true
+
jobs:
docs-build:
runs-on: ubuntu-latest
@@ -37,6 +41,11 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 10
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: pnpm
+ cache-dependency-path: home/pnpm-lock.yaml
- uses: actions/setup-python@v4
with:
python-version: '3.8'
diff --git a/.github/workflows/doc-deploy.yml b/.github/workflows/doc-deploy.yml
index 7b27a42961..2c962afdcc 100644
--- a/.github/workflows/doc-deploy.yml
+++ b/.github/workflows/doc-deploy.yml
@@ -27,6 +27,10 @@ on:
# Allow manual workflow trigger
workflow_dispatch:
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
# Set permissions for deployment
permissions:
contents: write
@@ -48,6 +52,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
+ cache: pnpm
+ cache-dependency-path: home/pnpm-lock.yaml
# Setup pnpm
- name: Setup pnpm
diff --git a/.github/workflows/frontend-build-test.yml
b/.github/workflows/frontend-build-test.yml
index 6c28cf999d..9a403df8d4 100644
--- a/.github/workflows/frontend-build-test.yml
+++ b/.github/workflows/frontend-build-test.yml
@@ -30,6 +30,10 @@ on:
paths:
- 'web-app/**'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: true
+
jobs:
build:
runs-on: ubuntu-latest
@@ -38,6 +42,11 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 10
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: pnpm
+ cache-dependency-path: web-app/pnpm-lock.yaml
- name: Install
working-directory: web-app
run: pnpm install
diff --git a/.github/workflows/license-checker.yml
b/.github/workflows/license-checker.yml
index d85a120ab0..44ab112359 100644
--- a/.github/workflows/license-checker.yml
+++ b/.github/workflows/license-checker.yml
@@ -26,6 +26,10 @@ on:
pull_request:
branches: [ master, dev ]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: true
+
jobs:
check-license-header:
name: check-license-header
diff --git a/.github/workflows/monitor-e2e-test.yml
b/.github/workflows/monitor-e2e-test.yml
index 5af1300fdf..ccdef33a23 100644
--- a/.github/workflows/monitor-e2e-test.yml
+++ b/.github/workflows/monitor-e2e-test.yml
@@ -27,6 +27,11 @@ on:
- cron: '0 1 * * *'
push:
branches: [ action* ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
check-license-header:
name: Monitor E2E Test
@@ -36,7 +41,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./script/ci/github-actions/setup-deps
- name: Build with Maven
- run: mvn clean -B package -Prelease -Dmaven.test.skip=true --file
pom.xml
+ run: mvnd -B clean package -Prelease -Dmaven.test.skip=true --file
pom.xml
- name: Build Image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
@@ -46,8 +51,6 @@ jobs:
tags: apache/hertzbeat:test
- name: Run K8s Monitor E2E Test
run: |
- sudo curl -L
https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64
-o /usr/local/bin/docker-compose
- sudo chmod u+x /usr/local/bin/docker-compose
cd e2e/k8s
- sudo docker-compose version
- sudo docker-compose up --exit-code-from testing --remove-orphans
+ docker compose version
+ docker compose up --exit-code-from testing --remove-orphans
diff --git a/.github/workflows/nightly-build.yml
b/.github/workflows/nightly-build.yml
index 0928a8d24d..9e2d4b6979 100644
--- a/.github/workflows/nightly-build.yml
+++ b/.github/workflows/nightly-build.yml
@@ -24,6 +24,10 @@ on:
push:
branches: [ action* ]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
build:
runs-on: ubuntu-latest
@@ -34,6 +38,11 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 10
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: pnpm
+ cache-dependency-path: web-app/pnpm-lock.yaml
- name: Build the Frontend
run: |
@@ -43,10 +52,7 @@ jobs:
- name: Build the Backend
run: |
- mvn clean install
- mvn clean package -Prelease -DskipTests
- cd hertzbeat-collector
- mvn clean package -Pcluster -DskipTests
+ mvnd -B clean package -Prelease,Pcluster -Dmaven.test.skip=false
--file pom.xml
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
diff --git a/script/ci/github-actions/setup-deps/action.yml
b/script/ci/github-actions/setup-deps/action.yml
index 3ad4560a58..e1fae549ec 100644
--- a/script/ci/github-actions/setup-deps/action.yml
+++ b/script/ci/github-actions/setup-deps/action.yml
@@ -26,15 +26,37 @@ runs:
with:
distribution: "zulu"
java-version: 25
+ cache: maven
+
+ - name: Validate mvnd runner support
+ shell: bash
+ run: |
+ if [ "${RUNNER_OS}" != "Linux" ] || [ "${RUNNER_ARCH}" != "X64" ]; then
+ echo "setup-deps currently supports mvnd only on Linux/X64 runners;
got ${RUNNER_OS}/${RUNNER_ARCH}" >&2
+ exit 1
+ fi
+
+ - name: Cache mvnd
+ id: mvnd-cache
+ uses: actions/cache@v4
+ with:
+ path: ~/.local/mvnd
+ key: mvnd-2.0.0-rc-3-linux-amd64
- name: Install mvnd
+ if: steps.mvnd-cache.outputs.cache-hit != 'true'
shell: bash
run: |
MVND_VERSION=2.0.0-rc-3
- curl -sL
https://dlcdn.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-linux-amd64.zip
-o mvnd.zip
+ MVND_PLATFORM=linux-amd64
+ curl -sL
https://dlcdn.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-${MVND_PLATFORM}.zip
-o mvnd.zip
unzip -q mvnd.zip
mkdir -p $HOME/.local
- mv maven-mvnd-${MVND_VERSION}-linux-amd64 $HOME/.local/mvnd
+ mv maven-mvnd-${MVND_VERSION}-${MVND_PLATFORM} $HOME/.local/mvnd
+
+ - name: Export mvnd environment
+ shell: bash
+ run: |
echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]