fixup! fixup! [CI] Activate dedicated Sonar GitHub action #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- "*" | |
pull_request: | |
branches: | |
- main | |
env: | |
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"' | |
GRADLE_SWITCHES: '--console=plain --info --stacktrace' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: gradle/actions/wrapper-validation@v3 | |
- name: set-up-jdk | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: build | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
arguments: ${{ env.GRADLE_SWITCHES }} build test | |
- name: "[Maven] Verify & generate JaCoCo XML" | |
env: | |
MAVEN_OPTS: '-Dstyle.color=always' | |
MAVEN_SWITCHES: >- | |
--show-version | |
--no-transfer-progress | |
--update-snapshots | |
--fail-at-end | |
--batch-mode | |
run: mvn ${{ env.MAVEN_SWITCHES }} -P coverage jacoco:prepare-agent verify jacoco:report | |
# Upload JaCoCo XML report as artifact | |
# https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts | |
- name: Upload code coverage results | |
uses: actions/upload-artifact@v4 | |
call-analyze-workflow: | |
needs: [build] | |
uses: './.github/workflows/analyse.yml' | |
publish-snapshots: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: set-up-jdk | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: publish-snapshots | |
uses: gradle/actions/setup-gradle@v3 | |
if: github.event_name == 'push' | |
timeout-minutes: 30 | |
with: | |
arguments: ${{ env.GRADLE_SWITCHES }} snapshot |