Skip to content

Build

Build #346

Workflow file for this run

name: Build
on:
push:
branches:
- master
- branch-*
- dogfood-*
pull_request:
workflow_dispatch:
schedule:
- cron: "30 1 * * *" # Run daily at 01:30 AM UTC
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: github-ubuntu-latest-s
permissions:
id-token: write # Required for Vault OIDC authentication
contents: write # Required for repository access and tagging
outputs:
build-number: ${{ steps.build.outputs.BUILD_NUMBER }}
deployed: ${{ steps.build.outputs.deployed }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
with:
version: 2025.7.12
- uses: SonarSource/ci-github-actions/build-maven@v1
id: build
with:
deploy-pull-request: true
artifactory-reader-role: private-reader
artifactory-deployer-role: qa-deployer
use-develocity: true
develocity-url: https://develocity-public.sonar.build/
build-win:
name: Build Windows
needs:
- build
runs-on: github-windows-latest-s
permissions:
id-token: write # Required for Vault OIDC authentication
contents: write # Required for repository access and tagging
env:
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
with:
version: 2025.7.12
- uses: SonarSource/ci-github-actions/build-maven@v1
with:
deploy: false
artifactory-reader-role: private-reader
artifactory-deployer-role: qa-deployer
use-develocity: true
develocity-url: https://develocity-public.sonar.build/
qa:
name: "QA - ${{ matrix.item.name }}"
if: ${{ needs.build.outputs.deployed }}
strategy:
fail-fast: false
matrix:
item:
- { name: "Plugin [Linux] - SQ: DEV", suite: "plugin", sq_version: "DEV", runner: "github-ubuntu-latest-s" }
- { name: "Plugin [Linux] - SQ: LATEST", suite: "plugin", sq_version: "LATEST_RELEASE", runner: "github-ubuntu-latest-s" }
- { name: "Ruling [Linux] - SQ: LATEST", suite: "ruling", sq_version: "LATEST_RELEASE", runner: "github-ubuntu-latest-s" }
- { name: "Ruling [Windows] - SQ: LATEST", suite: "ruling", sq_version: "LATEST_RELEASE", runner: "github-windows-latest-s" }
runs-on: ${{ matrix.item.runner }}
needs:
- build # We only need the build that deploys the artifacts to run ruling.
permissions:
id-token: write # Required for Vault OIDC authentication
contents: write # Required for repository access
env:
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
with:
version: 2025.7.12
- name: Vault
id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/github/token/licenses-ro token | GITHUB_TOKEN;
- name: Configure Maven
uses: SonarSource/ci-github-actions/config-maven@v1
with:
artifactory-reader-role: private-reader
use-develocity: true
develocity-url: https://develocity-public.sonar.build/
- name: Plugin QA Tests
shell: bash # Set explicitly so Bash is used on Windows runners too.
working-directory: "its/${{ matrix.item.suite }}"
env:
SUITE: ${{ matrix.item.suite }}
SQ_VERSION: ${{ matrix.item.sq_version }}
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
run: |
mvn verify "-Pit-${SUITE}" "-Dsonar.runtimeVersion=${SQ_VERSION}" -Dmaven.test.redirectTestOutputToFile=false -B -e -V
promote:
needs:
- build
- build-win
- qa
if: ${{ needs.build.outputs.deployed }}
runs-on: github-ubuntu-latest-s # Custom GitHub-hosted runner for public repos
name: Promote
permissions:
id-token: write # Required for Vault OIDC authentication
contents: write # Required for repository access and tagging
env:
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
steps:
- uses: SonarSource/ci-github-actions/promote@v1
with:
promote-pull-request: true