Skip to content

Commit 5749227

Browse files
changed build.yml
1 parent 1d2d92d commit 5749227

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
name: My Actions
2-
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
1+
name: my-actions
2+
33
on:
44
push:
55
branches:
66
- main
77
pull_request:
88
types: [ opened, synchronize, reopened ]
9-
jobs:
10-
build:
11-
name: Build and analyze
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: Set up JDK 17
18-
uses: actions/setup-java@v4
19-
with:
20-
java-version: 21
21-
distribution: 'temurin' # Alternative distribution options are available
22-
- name: Cache SonarQube packages
23-
uses: actions/cache@v4
24-
with:
25-
path: ~/.sonar/cache
26-
key: ${{ runner.os }}-sonar
27-
restore-keys: ${{ runner.os }}-sonar
28-
- name: Cache Gradle packages
29-
uses: actions/cache@v4
30-
with:
31-
path: ~/.gradle/caches
32-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
33-
restore-keys: ${{ runner.os }}-gradle
34-
- name: Build and analyze
35-
env:
36-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37-
run: ./gradlew build sonar --info
9+
10+
jobs:
11+
build:
12+
name: Build and analyze
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: 21
22+
distribution: 'temurin' # Alternative distribution options are available
23+
- name: Cache SonarQube packages
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.sonar/cache
27+
key: ${{ runner.os }}-sonar
28+
restore-keys: ${{ runner.os }}-sonar
29+
- name: Cache Gradle packages
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.gradle/caches
33+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
34+
restore-keys: ${{ runner.os }}-gradle
35+
- name: Build and analyze
36+
env:
37+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38+
run: ./gradlew build sonar --info

0 commit comments

Comments
 (0)