name: Build on: push: branches: - "main" paths-ignore: - '.gitattributes' - '.gitignore' - '.github/renovate.json5' - '.github/project.yaml' - 'docs/**' - 'README.md' pull_request: env: COMMON_MAVEN_OPTS: "-e -B --fae" jobs: build: runs-on: ubuntu-latest steps: - name: Checkout the code uses: https://github.com/actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 21 uses: https://github.com/actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' cache: 'maven' - name: Configure Maven CI/CD settings uses: https://github.com/s4u/maven-settings-action@v3.1.0 with: servers: | [{ "id": "kvant", "configuration": { "httpHeaders": { "property": { "name": "Authorization", "value": "token ${{ secrets.PHOENIX_PACKAGE_WRITER_TOKEN }}" } } } }] - name: Make maven wrapper executable run: chmod +x mvnw - name: Download dependencies run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline - name: Build and run tests run: ./mvnw $COMMON_MAVEN_OPTS verify - name: Analyze with Sonar if: vars.SONAR_ENABLED == 'true' env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} run: ./mvnw $COMMON_MAVEN_OPTS org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=quarkus-commons -Dsonar.projectName='quarkus-commons' -Dsonar.coverage.jacoco.xmlReportPaths=../**/target/jacoco-report/jacoco.xml - name: Publish jars if: github.ref == 'refs/heads/main' run: ./mvnw $COMMON_MAVEN_OPTS deploy -Dmaven.test.skip=true -Dmaven.javadoc.skip=true