Skip to content

chore(发布): 发布 2025.1.1 #38

chore(发布): 发布 2025.1.1

chore(发布): 发布 2025.1.1 #38

Workflow file for this run

name: Checker
on:
push:
pull_request:
branches: [ "dev" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '17' ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Check Code Style
run: ./mvnw checkstyle:check
- name: Check Spotbugs
run: ./mvnw spotbugs:check
# 执行所有模块的测试
- name: Run Unit Tests
run: ./mvnw -B test
# 收集所有模块的测试报告
- name: Publish Test Results
uses: dorny/test-reporter@v1
if: always()
with:
name: JUnit Tests (${{ matrix.java }})
path: '**/target/surefire-reports/TEST-*.xml'
reporter: java-junit
fail-on-error: false
- name: Build with Maven
run: ./mvnw -B clean package
# 上传所有模块的测试结果
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.java }}
path: |
**/target/surefire-reports/
**/target/site/surefire-report.html
# 收集所有模块的覆盖率报告
- name: Generate Test Coverage Report
run: ./mvnw -B jacoco:report
- name: Upload Coverage Report
if: matrix.java == '8'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
**/target/site/jacoco/
**/target/site/jacoco/jacoco.xml
- name: Report Coverage to Codecov
if: matrix.java == '8'
uses: codecov/codecov-action@v3
with:
files: '**/target/site/jacoco/jacoco.xml'
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Run Dependency Check
run: ./mvnw org.owasp:dependency-check-maven:check
- name: Upload Dependency Check Results
if: always()
uses: actions/upload-artifact@v4
with:
name: dependency-check-report
path: '**/target/dependency-check-report.html'