Skip to content

Commit

Permalink
🛠️ Fix Qodana GitHub action configuration
Browse files Browse the repository at this point in the history
Otherwise, Qodana Inspection fails with:

> /opt/hostedtoolcache/qodana/2024.1.5/x64/qodana scan --cache-dir /home/runner/work/_temp/qodana/caches --results-dir /home/runner/work/_temp/qodana/results --skip-pull  --commit 6cad619
> fatal: Could not parse object '6cad619456919661c18f21ae8479dce247be9f7f'.
>
> !  Could not reset git repository, no --commit option will be applied: exit status 128
> time="2024-09-28T19:20:08Z" level=fatal msg="Failed to prepare diff run nothing to compare between 6cad619 and 2b80ff6"
> ✗  Qodana exited with code 1
>
> !  Check ./logs/ in the results directory for more information
> Error: qodana scan failed with exit code 1

The version upgrade was suggested here:
JetBrains/intellij-platform-gradle-plugin#1736.
  • Loading branch information
lunakoly committed Sep 29, 2024
1 parent 185781f commit 435f28d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,27 @@ jobs:
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
# See: https://github.com/marketplace/actions/qodana-scan#basic-configuration
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

# Qodana Community for JVM 2024.2.2 RC complains about:
# > java.nio.file.NoSuchFileException: /opt/idea/plugins/sh/lib/sh.jar
# ...and...
# > Cannot find a Java installation on your machine matching this tasks requirements:
# > {languageVersion=11, vendor=any, implementation=vendor-specific} for LINUX on x86_64.
# (no idea why it's even used with `JetBrains/[email protected]`, a cache issue?)
# (and the error doesn't even go away!)

# Set up Java environment for the next steps
# Qodana needs a modern Java, otherwise it'll fail with:
# > Dependency requires at least JVM runtime version 17. This build uses a Java 11 JVM.
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

# Run Qodana inspections
- name: Qodana - Code Inspection
Expand Down
2 changes: 1 addition & 1 deletion qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

version: 1.0
linter: jetbrains/qodana-jvm-community:latest
projectJDK: "17"
projectJDK: "21"
profile:
name: qodana.recommended
exclude:
Expand Down

0 comments on commit 435f28d

Please sign in to comment.