Skip to content

Commit ae18325

Browse files
tomasz-tylenda-sonarsourcesonartech
authored andcommitted
SONARSLANG-716 Migrate build from Cirrus to GitHub actions (#580)
1 parent bc22cc9 commit ae18325

File tree

5 files changed

+63
-1
lines changed

5 files changed

+63
-1
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- branch-*
7+
- dogfood-*
8+
pull_request:
9+
workflow_dispatch:
10+
schedule:
11+
- cron: "30 3 * * *" # Run daily at 03:30 AM UTC
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: sonar-xs
20+
name: Build
21+
permissions:
22+
id-token: write # Required for Vault OIDC authentication
23+
contents: write # Required for repository access and tagging
24+
steps:
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
27+
with:
28+
version: 2025.7.12
29+
- uses: SonarSource/ci-github-actions/build-gradle@v1
30+
with:
31+
artifactory-deploy-repo: sonarsource-public-qa
32+
deploy-pull-request: true
33+
use-develocity: true
34+
35+
promote:
36+
needs:
37+
- build
38+
runs-on: sonar-xs
39+
name: Promote
40+
permissions:
41+
id-token: write # Required for Vault OIDC authentication
42+
contents: write # Required for repository access and tagging
43+
steps:
44+
- uses: SonarSource/ci-github-actions/promote@v1
45+
with:
46+
promote-pull-request: true

.github/workflows/pr-cleanup.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Cleanup PR Resources
2+
on:
3+
pull_request:
4+
types: [closed]
5+
6+
jobs:
7+
cleanup:
8+
runs-on: sonar-xs
9+
permissions:
10+
actions: write
11+
steps:
12+
- uses: SonarSource/ci-github-actions/pr_cleanup@v1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SLang
22

3-
[![Build Status](https://api.cirrus-ci.com/github/SonarSource/slang.svg?branch=master)](https://cirrus-ci.com/github/SonarSource/slang)
3+
[![Build](https://github.com/SonarSource/slang-enterprise/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/SonarSource/slang-enterprise/actions/workflows/build.yml)
44
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=org.sonarsource.slang%3Aslang&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.sonarsource.slang%3Aslang)
55
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.sonarsource.slang%3Aslang&metric=coverage)](https://sonarcloud.io/component_measures/domain/Coverage?id=org.sonarsource.slang%3Aslang)
66

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ subprojects {
217217
def signingPassword = findProperty("signingPassword")
218218
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
219219
required {
220+
// TODO: switch to GitHub Actions or remove.
220221
def branch = System.getenv()["CIRRUS_BRANCH"]
221222
return (branch == 'master' || branch ==~ 'branch-[\\d.]+') &&
222223
gradle.taskGraph.hasTask(":artifactoryPublish")

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
java = "17"
3+
gradle = "7.6"

0 commit comments

Comments
 (0)