From 9955f23f317019b0f363b0e2b2fda510b1958e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=20K=C3=BCng?= Date: Tue, 3 Mar 2026 09:04:12 +0100 Subject: [PATCH] feat(chore): added qodana analysis job --- .gitea/workflows/cicd.yaml | 26 ++++++++++++++++++++- backend/qodana.yaml | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 backend/qodana.yaml diff --git a/.gitea/workflows/cicd.yaml b/.gitea/workflows/cicd.yaml index dc14714..50054f2 100644 --- a/.gitea/workflows/cicd.yaml +++ b/.gitea/workflows/cicd.yaml @@ -1,14 +1,38 @@ -name: Build, Test and Deploy +name: Build, Test, Deploy and Analysis on: push: branches: [main, int, dev] + pull_request: # <--- Abilita l'esecuzione sulle Pull Request + branches: [main, int, dev] + workflow_dispatch: concurrency: group: print-calculator-${{ gitea.ref }} cancel-in-progress: true jobs: + # --- JOB DI ANALISI (In parallelo) --- + qodana: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fondamentale per Qodana per analizzare la storia + + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2025.3 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + with: + # In Gitea, pr-mode funziona se il runner ha accesso ai dati del clone + pr-mode: ${{ gitea.event_name == 'pull_request' }} + use-caches: true + # Nota: Gitea ha un supporto limitato per i commenti automatici + # rispetto a GitHub, ma l'analisi verrĂ  eseguita correttamente. + post-pr-comment: false + use-annotations: true test-backend: runs-on: ubuntu-latest steps: diff --git a/backend/qodana.yaml b/backend/qodana.yaml new file mode 100644 index 0000000..05a38ce --- /dev/null +++ b/backend/qodana.yaml @@ -0,0 +1,48 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# + +################################################################################# +# WARNING: Do not store sensitive information in this file, # +# as its contents will be included in the Qodana report. # +################################################################################# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.starter + +#Enable inspections +#include: +# - name: + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +projectJDK: "21" #(Applied in CI/CD pipeline) + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +# Quality gate. Will fail the CI/CD pipeline if any condition is not met +# severityThresholds - configures maximum thresholds for different problem severities +# testCoverageThresholds - configures minimum code coverage on a whole project and newly added code +# Code Coverage is available in Ultimate and Ultimate Plus plans +#failureConditions: +# severityThresholds: +# any: 15 +# critical: 5 +# testCoverageThresholds: +# fresh: 70 +# total: 50 + +#Specify Qodana linter for analysis (Applied in CI/CD pipeline) +linter: jetbrains/qodana-jvm:2025.3