|
| 1 | +name: Build |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - branch-* |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +permissions: |
| 15 | + id-token: write |
| 16 | + contents: write |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + name: Build |
| 21 | + runs-on: github-ubuntu-latest-s |
| 22 | + timeout-minutes: 30 |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 |
| 28 | + with: |
| 29 | + version: 2025.7.12 |
| 30 | + tool_versions: | |
| 31 | + java 21 |
| 32 | +
|
| 33 | + - uses: SonarSource/ci-github-actions/build-maven@v1 |
| 34 | + with: |
| 35 | + artifactory-reader-role: private-reader |
| 36 | + artifactory-deployer-role: qa-deployer |
| 37 | + deploy-pull-request: true |
| 38 | + - name: Upload test results on failure |
| 39 | + if: failure() |
| 40 | + uses: actions/upload-artifact@v4 |
| 41 | + with: |
| 42 | + name: test-results |
| 43 | + path: '**/target/surefire-reports/**/*.xml' |
| 44 | + if-no-files-found: ignore |
| 45 | + |
| 46 | + qa: |
| 47 | + name: QA - SQ ${{ matrix.SQ_VERSION }} |
| 48 | + needs: build |
| 49 | + runs-on: github-ubuntu-latest-s |
| 50 | + env: |
| 51 | + JAVA_VERSION: LATEST_RELEASE |
| 52 | + strategy: |
| 53 | + fail-fast: false |
| 54 | + matrix: |
| 55 | + SQ_VERSION: |
| 56 | + - LATEST_RELEASE |
| 57 | + - LATEST_RELEASE[2025.1] |
| 58 | + - LATEST_RELEASE[9.9] |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 61 | + |
| 62 | + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 |
| 63 | + with: |
| 64 | + version: 2025.7.12 |
| 65 | + tool_versions: | |
| 66 | + java 17 |
| 67 | +
|
| 68 | + - name: Getting Vault Secrets |
| 69 | + uses: SonarSource/vault-action-wrapper@v3 |
| 70 | + with: |
| 71 | + secrets: | |
| 72 | + development/artifactory/token/SonarSource-sonar-scanner-java-library-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN; |
| 73 | + development/github/token/licenses-ro token | GITHUB_TOKEN |
| 74 | +
|
| 75 | + - name: Configure Maven |
| 76 | + uses: SonarSource/ci-github-actions/config-maven@v1 |
| 77 | + with: |
| 78 | + artifactory-reader-role: private-reader |
| 79 | + |
| 80 | + - name: Run ITs |
| 81 | + run: | |
| 82 | + cd its |
| 83 | + mvn -B -e verify -Prun-its -Dsonar.runtimeVersion=${{ matrix.SQ_VERSION }} -DjavaVersion=${{ env.JAVA_VERSION }} |
| 84 | +
|
| 85 | + - name: Upload server logs |
| 86 | + if: failure() |
| 87 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 88 | + with: |
| 89 | + name: server-logs-${{ github.job }}-${{ strategy.job-index }} |
| 90 | + path: "**/target/**/logs/**.log" |
| 91 | + if-no-files-found: ignore |
| 92 | + |
| 93 | + - name: Upload test results |
| 94 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 95 | + if: failure() |
| 96 | + with: |
| 97 | + name: test-results-${{ github.job }}-${{ strategy.job-index }} |
| 98 | + path: "**/target/surefire-reports/**.xml" |
| 99 | + if-no-files-found: ignore |
| 100 | + |
| 101 | + promote: |
| 102 | + name: Promote |
| 103 | + needs: qa |
| 104 | + runs-on: github-ubuntu-latest-s |
| 105 | + steps: |
| 106 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 107 | + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 |
| 108 | + with: |
| 109 | + cache_save: false |
| 110 | + version: 2025.7.12 |
| 111 | + - uses: SonarSource/ci-github-actions/get-build-number@v1 |
| 112 | + - uses: SonarSource/ci-github-actions/promote@v1 |
| 113 | + with: |
| 114 | + promote-pull-request: true |
0 commit comments