-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.6 KB
/
Copy pathworkflow.yml
File metadata and controls
59 lines (48 loc) · 1.6 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
name: 'Run workflow'
on:
push:
branches: [main]
paths:
- 'src/**'
- '.github/workflows/workflow.yml'
pull_request:
branches: [main]
paths:
- 'src/**'
- '.github/workflows/workflow.yml'
jobs:
project-build:
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v4
# Ensure the gradle-wrapper.jar file is legitimate
# For explanations, see https://tomgregory.com/gradle/build-gradle-projects-with-github-actions/
- uses: gradle/wrapper-validation-action@v2
# Install Java 21, enable Gradle caching
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: gradle
# Build the project, skipping checkstyle and tests
- name: Build
run: ./gradlew build --no-daemon -x checkstyleMain -x checkstyleTest -x test
# Run checkstyle on main and test
- name: Run Checkstyle
run: ./gradlew checkstyleMain checkstyleTest
# Run all the tests
- name: Run Tests
run: ./gradlew test
# Run coverage with JaCoCo
- name: Run Coverage
run: |
./gradlew jacocoTestCoverageVerification
./gradlew jacocoTestReport
# Create a JaCoCo Badge with the computed coverage (can be found on the workflow page)
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2.11.0
with:
generate-branches-badge: true
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv