Skip to content

Activate SonarQube

Activate SonarQube #76

name: Continuous Integration
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- name: Build with Gradle
working-directory: ./generator
run: ./gradlew build
- name: Upload received files from failing tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: Received-${{ runner.os }}
path: "generator/actual_*"
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: TestResults-${{ runner.os }}
path: generator/build/reports/tests/test
- name: SonarQube
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./generator
run: ./gradlew jacocoTestReport sonar -Dsonar.token=$SONAR_TOKEN