Skip to content

ci: Add qodana analysis #32

ci: Add qodana analysis

ci: Add qodana analysis #32

name: Qodana analysis
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- develop
jobs:
qodana:
strategy:
matrix:
minecraft: [1.16.5]
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- run: mkdir -p nms-build/.m2/repository
- name: Restore cached NMS
id: cache-nms-restore
uses: actions/cache/restore@v4
with:
path: |
nms-build/.m2/repository
key: nms-spigot-${{ matrix.minecraft }}
- uses: PeyaPeyaPeyang/nmsaction@v3
if: "steps.cache-nms-restore.outputs.cache-hit != 'true'"
with:
rev: ${{ matrix.minecraft }}
- name: Save NMS to cache
id: cache-nms-save
uses: actions/cache/save@v4
if: "steps.cache-nms-restore.outputs.cache-hit != 'true'"
with:
path: |
nms-build/.m2/repository
key: nms-spigot-${{ matrix.minecraft }}
- name: Retrieve the absolute path of .m2
id: m2-path
run: |
M2_PATH=$(pwd)/nms-build/.m2/repository
echo "m2-path=$M2_PATH" >> $GITHUB_OUTPUT
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@main
with:
args: --volume,${{ steps.m2-path.outputs.m2-path }}:/root/.m2/repository
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}