File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : log4u-build
2+ on :
3+ push :
4+ branches :
5+ - dev # dev 브랜치 push
6+ pull_request :
7+ branches :
8+ - main # main pr
9+ types : [ opened, synchronize, reopened ]
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 21
19+ uses : actions/setup-java@v4
20+ with :
21+ java-version : 21
22+ distribution : ' zulu' # Alternative distribution options are available
23+ - name : Cache Gradle packages
24+ uses : actions/cache@v4
25+ with :
26+ path : ~/.gradle/caches
27+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
28+ restore-keys : ${{ runner.os }}-gradle
29+ - name : Cache SonarCloud packages
30+ uses : actions/cache@v4
31+ with :
32+ path : ~/.sonar/cache
33+ key : ${{ runner.os }}-sonar
34+ restore-keys : ${{ runner.os }}-sonar
35+ - name : Build and analyze
36+ env :
37+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
38+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
39+ DB_URL : ${{ secrets.DB_URL }} # Database URL
40+ DB_USERNAME : ${{ secrets.DB_USERNAME }} # Database username
41+ DB_PASSWORD : ${{ secrets.DB_PASSWORD }} # Database password
42+ run : |
43+ chmod +x ./gradlew
44+ ./gradlew build jacocoTestReport sonar --info
You can’t perform that action at this time.
0 commit comments