Skip to content

Commit f75508c

Browse files
committed
ci: 标准化 GitHub Actions 配置(每分支独立 CI,JDK 按版本线 8/17/21,JaCoCo 覆盖率门禁)
1 parent 4855734 commit f75508c

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# CI workflow for the feature/3.0.x line (JDK 21)
2+
#
3+
# Triggers:
4+
# - push / pull_request on the feature/3.0.x branch
5+
# - manual workflow_dispatch
6+
#
7+
# Runs `./mvnw -B clean verify` which includes the JaCoCo coverage gate
8+
# (90% line coverage, haltOnFailure=false) configured in the POM.
9+
name: CI
10+
11+
on:
12+
push:
13+
branches: [feature/3.0.x]
14+
pull_request:
15+
branches: [feature/3.0.x]
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
name: JDK 21 Build & Verify
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 30
26+
steps:
27+
- name: Checkout source
28+
uses: actions/checkout@v4
29+
30+
- name: Set up JDK 21
31+
uses: actions/setup-java@v4
32+
with:
33+
distribution: temurin
34+
java-version: '21'
35+
cache: maven
36+
37+
- name: Build and verify with JaCoCo coverage gate
38+
run: ./mvnw -B --no-transfer-progress clean verify
39+
40+
- name: Upload JaCoCo coverage report
41+
if: always()
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: jacoco-coverage
45+
path: target/site/jacoco
46+
retention-days: 14
47+
48+
- name: Upload surefire reports
49+
if: always()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: surefire-reports
53+
path: target/surefire-reports
54+
retention-days: 14

0 commit comments

Comments
 (0)