Skip to content

Fix tests

Fix tests #1267

Workflow file for this run

name: "Analysis"
on:
push:
branches:
- master
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read # CodeQL
contents: read # CodeQL
security-events: write # CodeQL
pull-requests: read # Sonarqube
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Disable shallow clone for sonarqube analysis
- name: Check gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: java
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'graalvm'
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build, test and generate reports
run: ./gradlew build test jacocoTestReport --no-build-cache --info # Disabling the build cache is needed for CodeQL (otherwise compilation output might not be generated)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- name: Perform Sonarqube Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar