Compare commits
6 Commits
e729ffcd41
...
48943160f1
| Author | SHA1 | Date |
|---|---|---|
|
|
48943160f1 | |
|
|
4d6e1cbb3a | |
|
|
652567aa8b | |
|
|
f0b786d740 | |
|
|
a55ff88e08 | |
|
|
f39c19fb5c |
|
|
@ -45,13 +45,56 @@ jobs:
|
|||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Set up JDK for potential code generation (e.g., protobuf) prior to Qodana analysis
|
||||
- name: Set up Java 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
cache: 'maven'
|
||||
|
||||
# Generate sources so that Qodana resolves imports from generated code
|
||||
- name: Generate sources (protobuf)
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -f ./mvnw ]; then chmod +x ./mvnw || true; fi
|
||||
if [ -x ./mvnw ]; then
|
||||
./mvnw -B -DskipTests -DskipITs=true generate-sources || true
|
||||
elif command -v mvn >/dev/null 2>&1; then
|
||||
mvn -B -DskipTests -DskipITs=true generate-sources || true
|
||||
else
|
||||
echo "[Qodana prep] Maven not available; skipping generate-sources"
|
||||
fi
|
||||
|
||||
# Optionally compile (skip tests) to ensure classes are available for resolution
|
||||
- name: Compile (skip tests)
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -x ./mvnw ]; then
|
||||
./mvnw -B -DskipTests -DskipITs=true compile || true
|
||||
elif command -v mvn >/dev/null 2>&1; then
|
||||
mvn -B -DskipTests -DskipITs=true compile || true
|
||||
else
|
||||
echo "[Qodana prep] Maven not available; skipping compile"
|
||||
fi
|
||||
|
||||
# Helpful debug: list generated sources if present
|
||||
- name: Show generated sources
|
||||
shell: bash
|
||||
run: |
|
||||
echo "=== target/generated-sources (tree) ===" || true
|
||||
if [ -d target/generated-sources ]; then
|
||||
find target/generated-sources -maxdepth 3 -type d -print || true
|
||||
else
|
||||
echo "(none)" || true
|
||||
fi
|
||||
- name: 'Qodana Scan'
|
||||
uses: JetBrains/qodana-action@v2025.2
|
||||
with:
|
||||
# Enable PR-specific reporting only for pull_request events
|
||||
pr-mode: ${{ github.event_name == 'pull_request' }}
|
||||
# Pass the linter image via args (the action does not support an `image` input)
|
||||
args: --image jetbrains/qodana-jvm:2025.2
|
||||
# No extra args needed; linter is defined in qodana.yaml (qodana-jvm)
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_268690425 }}
|
||||
QODANA_ENDPOINT: 'https://qodana.cloud'
|
||||
|
|
|
|||
21
qodana.yaml
21
qodana.yaml
|
|
@ -3,28 +3,19 @@
|
|||
####################################################################################################################
|
||||
|
||||
version: "1.0"
|
||||
linter: jetbrains/qodana-jvm:2025.2
|
||||
# Use canonical linter name to avoid image warnings and CLI flag issues
|
||||
linter: qodana-jvm
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
bootstrap: |
|
||||
# Generate sources (including protobuf) so Qodana resolves imports correctly
|
||||
# Prefer Maven Wrapper if present; fall back to system mvn (POSIX sh compatible)
|
||||
# Ensure mvnw is executable if present
|
||||
if [ -f ./mvnw ]; then chmod +x ./mvnw || true; fi
|
||||
if [ -x ./mvnw ]; then
|
||||
./mvnw -B -q -DskipTests -DskipITs=true generate-sources || true
|
||||
elif [ -f ./mvnw ]; then
|
||||
sh ./mvnw -B -q -DskipTests -DskipITs=true generate-sources || true
|
||||
elif command -v mvn >/dev/null 2>&1; then
|
||||
mvn -B -q -DskipTests -DskipITs=true generate-sources || true
|
||||
else
|
||||
echo "[Qodana bootstrap] Maven not available; skipping source generation"
|
||||
fi
|
||||
# Disabled bootstrap to avoid shell parsing issues in CI. If you need code generation,
|
||||
# we can re-enable a robust script later. For now, do nothing and let Qodana run.
|
||||
:
|
||||
include:
|
||||
- name: CheckDependencyLicenses
|
||||
exclude:
|
||||
# Exclude generated sources from inspections to reduce noise
|
||||
- name: All
|
||||
paths:
|
||||
- target/generated-sources/**
|
||||
- target/protoc-dependencies/**
|
||||
# Keep generated sources included for indexing/resolution; excluding them can cause unresolved imports
|
||||
Loading…
Reference in New Issue