Skip to content

Commit adad16f

Browse files
GFB-24 Migrates CI to GitHub Actions (#58)
1 parent 92d39af commit adad16f

File tree

6 files changed

+83
-69
lines changed

6 files changed

+83
-69
lines changed

.cirrus.star

Lines changed: 0 additions & 4 deletions
This file was deleted.

.cirrus.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- 'branch-*'
7+
pull_request:
8+
merge_group:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
id-token: write
17+
contents: write
18+
19+
jobs:
20+
build:
21+
name: Build
22+
runs-on: github-ubuntu-latest-s
23+
timeout-minutes: 30
24+
steps:
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
fetch-depth: 0
28+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
29+
with:
30+
version: 2025.7.12
31+
- uses: SonarSource/ci-github-actions/build-gradle@v1
32+
with:
33+
artifactory-reader-role: private-reader
34+
artifactory-deployer-role: qa-deployer
35+
deploy-pull-request: true
36+
- name: Upload build reports on failure
37+
if: failure()
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: build-reports
41+
path: '**/build/reports/**/*'
42+
if-no-files-found: ignore
43+
- name: Upload test results on failure
44+
if: failure()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: test-results
48+
path: '**/test-results/**/*.xml'
49+
if-no-files-found: ignore

.github/workflows/promote.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Promote
2+
on:
3+
workflow_run:
4+
workflows: [Build]
5+
types: [completed]
6+
branches:
7+
- master
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
13+
jobs:
14+
promote:
15+
name: Promote
16+
if: |
17+
github.event.workflow_run.conclusion == 'success' &&
18+
github.repository_owner == 'SonarSource'
19+
runs-on: github-ubuntu-latest-s
20+
timeout-minutes: 30
21+
steps:
22+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
- uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
24+
with:
25+
version: 2025.7.12
26+
- uses: SonarSource/ci-github-actions/promote-gradle@v1

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ signing {
176176
def signingPassword = findProperty("signingPassword")
177177
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
178178
required {
179-
def branch = System.getenv()["CIRRUS_BRANCH"]
179+
def branch = System.getenv()["GITHUB_REF_NAME"]
180180
return (branch == 'master' || branch ==~ 'branch-[\\d.]+') &&
181181
gradle.taskGraph.hasTask(":artifactoryPublish")
182182
}
@@ -185,7 +185,7 @@ signing {
185185

186186
tasks.withType(Sign) {
187187
onlyIf {
188-
def branch = System.getenv()["CIRRUS_BRANCH"]
188+
def branch = System.getenv()["GITHUB_REF_NAME"]
189189
return !artifactoryPublish.skip &&
190190
(branch == 'master' || branch ==~ 'branch-[\\d.]+') &&
191191
gradle.taskGraph.hasTask(":artifactoryPublish")

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ group=org.sonarsource.git.blame
22
version=2.1-SNAPSHOT
33
description=A git command implemented with JGit that blames multiple files simultaneously
44
projectTitle=git-files-blame
5+
6+
# Gradle daemon configuration
7+
org.gradle.daemon=false
8+
9+
# JVM arguments for Gradle
10+
org.gradle.jvmargs=-XX:+PrintFlagsFinal -XshowSettings:vm -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF8 -Duser.language=en -Duser.country=US

0 commit comments

Comments
 (0)