-
-
Notifications
You must be signed in to change notification settings - Fork 442
35 lines (28 loc) · 843 Bytes
/
gradle-ci.yml
File metadata and controls
35 lines (28 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Java CI with Gradle and SonarQube
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-analyze:
name: Build and SonarQube Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Grant execute permission for Gradle
run: chmod +x ./gradlew
- name: Build and run SonarQube analysis
run: ./gradlew build sonarqube --no-daemon
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}