-
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 2 KB
/
main.yml
File metadata and controls
73 lines (60 loc) · 2 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
INSTANCE_MEMORY: ${{ secrets.INSTANCE_MEMORY }}
jobs:
build-deploy:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
#run: checkstyleMain, checkstyleTest, pmdMain, pmdTest and test
- name: Check Code Quality
run: ./gradlew check
- name: Coverage Report
run: ./gradlew jacocoTestReport
- name: Coverage Verification
run: ./gradlew jacocoTestCoverageVerification
- name: Generate Jacoco Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv
badges-directory: build/reports/jacoco/test/html/badges
- name: Upload JaCoCo coverage report
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: build/reports/jacoco/test/
- name: Publish coverage report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/reports/jacoco/test/html
- name: Build and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar