Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/java-static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Java Static Analysis

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
build-and-analyze:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Set up JDK 17 with Maven cache
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
cache: maven

- name: Build and run static analysis
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: |
mvn clean verify -DskipTests

- name: Debug report files
if: always()
run: |
echo "==== reports dir ===="
find . -type d -path "*/target/reports" | sort || true
echo "==== site dir ===="
find . -type d -path "*/target/site" | sort || true
echo "==== report files ===="
find . -type f \( \
-name "checkstyle.html" -o \
-name "pmd.html" -o \
-name "checkstyle-result.xml" -o \
-name "pmd.xml" -o \
-name "spotbugs.html" -o \
-name "spotbugs.xml" -o \
-name "spotbugsXml.xml" -o \
-name "dependency-check-report.html" \
\) | sort || true

- name: Upload reports directories
if: always()
uses: actions/upload-artifact@v4
with:
name: analysis-report-sites
path: |
**/target/reports/**
**/target/site/**
retention-days: 7
if-no-files-found: warn

- name: Upload XML and root HTML reports
if: always()
uses: actions/upload-artifact@v4
with:
name: analysis-report-files
path: |
**/target/checkstyle-result.xml
**/target/checkstyle-checker.xml
**/target/pmd.xml
**/target/spotbugs.xml
**/target/spotbugsXml.xml
**/target/dependency-check-report.html
retention-days: 7
if-no-files-found: warn
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public void insertFill(MetaObject metaObject) {
public void updateFill(MetaObject metaObject) {
strictUpdateFill(metaObject, "updateTime", Date::new, Date.class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public class VectorCollectionAlreadyExistsException extends ServiceException {
public VectorCollectionAlreadyExistsException(String collectionName) {
super("向量集合已存在,禁止重复创建:" + collectionName);
}
}
}
Loading