Qodana 2025.2 Help

Add Qodana to your CI pipeline

Qodana provides solutions for various CI systems; several of them are implemented as native solutions, while for several others you can run Docker images of Qodana, see the table below:

This section shows how you can configure Qodana for GitHub Actions and Jenkins pipelines. The complete guides for other CI systems including basic configuration examples are available in the Overview of CI integration section.

GitHub Actions

  1. On the Settings tab of the GitHub UI, create the QODANA_TOKEN encrypted secret and save the project token as its value. If you are using a Qodana Cloud instance other than https://qodana.cloud/, override it by declaring the QODANA_ENDPOINT environment variable.

  2. On the Actions tab of the GitHub UI, set up a new workflow and create the .github/workflows/code_quality.yml file.

  3. To analyze the main and master branches, as well as release branches and the pull requests coming to your repository, save this workflow configuration to the .github/workflows/code_quality.yml file:

    name: Qodana on: workflow_dispatch: pull_request: push: branches: # Specify your branches here - main # The 'main' branch - master # The 'master' branch - 'releases/*' # The release branches jobs: qodana: runs-on: ubuntu-latest permissions: contents: write pull-requests: write checks: write steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2025.2 env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

Jenkins

Jenkins is a good example of how you can use Docker images of Qodana.

Prepare your project

Make sure that these plugins are installed on your Jenkins instance:

Make sure that Docker is installed and accessible to Jenkins.

If applicable, make sure that Docker is accessible to the jenkins user as described in the Manage Docker as a non-root user section of the Docker documentation.

Create a Multibranch Pipeline project as described on the Jenkins documentation portal.

In the root directory of your project repository, create the Jenkinsfile. This file will contain Jenkins configuration scripts described in this section.

This is the basic configuration of the Jenkins Pipeline.

pipeline { environment { QODANA_TOKEN=credentials('qodana-token') } agent { docker { args ''' -v "${WORKSPACE}":/data/project --entrypoint="" ''' image 'jetbrains/qodana-<linter>' } } stages { stage('Qodana') { steps { sh '''qodana''' } } } }

In this configuration, the environment block defines any environment variables to be used in the pipeline. The QODANA_TOKEN variable refers to the project token generated in Qodana Cloud and is contained in the qodana-token global credentials.

This configuration uses the docker agent to invoke Qodana Docker images. Using the WORKSPACE variable, the args block mounts the local checkout directory to the project directory of a Docker image, and image specifies the Docker image invoked.

What's next

You can extend the existing CI configurations. For example, you can employ the quality gate or baseline features.

08 August 2025