Skip to content

Commit 1e5816a

Browse files
dfa1claude
andcommitted
chore(ci): move Sonar to daily scheduled workflow
Sonar on every push/PR was overkill — adds ~1m to every CI run and churns SonarCloud quota. Moved to its own workflow running daily at 07:00 UTC plus on-demand via workflow_dispatch. CI workflow reverts to plain build/test on the full matrix. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c600e3d commit 1e5816a

2 files changed

Lines changed: 53 additions & 27 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v6
21-
with:
22-
# Sonar needs full history for line-level blame / new-code computation.
23-
fetch-depth: ${{ (matrix.os == 'ubuntu-latest' && matrix.java-version == '25') && 0 || 1 }}
2421

2522
- name: Set up Azul Zulu JDK ${{ matrix.java-version }}
2623
uses: actions/setup-java@v5
@@ -36,35 +33,13 @@ jobs:
3633
restore-keys: |
3734
${{ runner.os }}-maven-
3835
39-
- name: Cache SonarCloud packages
40-
if: matrix.os == 'ubuntu-latest' && matrix.java-version == '25'
41-
uses: actions/cache@v5
42-
with:
43-
path: ~/.sonar/cache
44-
key: ${{ runner.os }}-sonar
45-
restore-keys: ${{ runner.os }}-sonar
46-
4736
# vortex-jni 0.74.0 ships native libs for darwin-aarch64 + linux-aarch64
4837
# + linux-amd64 only. No Windows binary, so the modules that pull vortex-jni
4938
# (integration, performance) are skipped on Windows. Being the only Vortex
5039
# impl that runs on Windows JVMs is one of vortex-java's selling points —
5140
# see README "Who is this for".
52-
# JaCoCo coverage is collected only on the Ubuntu + Java 25 entry — running it on
53-
# every matrix entry would produce redundant reports and slow the build.
54-
- name: Build, test, and Sonar analysis (Linux)
55-
if: matrix.os == 'ubuntu-latest' && matrix.java-version == '25'
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
59-
run: |
60-
./mvnw verify -P coverage \
61-
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
62-
-Dsonar.projectKey=dfa1_vortex-java \
63-
-Dsonar.organization=dfa1 \
64-
-Dsonar.host.url=https://sonarcloud.io
65-
66-
- name: Build and test (Linux + macOS) without coverage
67-
if: runner.os != 'Windows' && !(matrix.os == 'ubuntu-latest' && matrix.java-version == '25')
41+
- name: Build and test (Linux + macOS)
42+
if: runner.os != 'Windows'
6843
run: ./mvnw verify
6944

7045
- name: Build and test (Windows)

.github/workflows/sonar.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Sonar
2+
3+
# SonarCloud analysis runs once per day (07:00 UTC) on main, plus on-demand
4+
# via the workflow_dispatch button. Kept out of the per-push CI workflow to
5+
# keep PRs fast and reduce SonarCloud quota usage.
6+
on:
7+
schedule:
8+
- cron: '0 7 * * *'
9+
workflow_dispatch:
10+
11+
jobs:
12+
sonar:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
# Full history needed for line-level blame / new-code computation.
19+
fetch-depth: 0
20+
21+
- name: Set up Azul Zulu JDK 25
22+
uses: actions/setup-java@v5
23+
with:
24+
distribution: zulu
25+
java-version: '25'
26+
27+
- name: Cache Maven repository
28+
uses: actions/cache@v5
29+
with:
30+
path: ~/.m2/repository
31+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: |
33+
${{ runner.os }}-maven-
34+
35+
- name: Cache SonarCloud packages
36+
uses: actions/cache@v5
37+
with:
38+
path: ~/.sonar/cache
39+
key: ${{ runner.os }}-sonar
40+
restore-keys: ${{ runner.os }}-sonar
41+
42+
- name: Build, test, and Sonar analysis
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
46+
run: |
47+
./mvnw verify -P coverage \
48+
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
49+
-Dsonar.projectKey=dfa1_vortex-java \
50+
-Dsonar.organization=dfa1 \
51+
-Dsonar.host.url=https://sonarcloud.io

0 commit comments

Comments
 (0)