-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (52 loc) · 1.65 KB
/
gradle.yml
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
name: Java CI with Gradle
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
repository_dispatch:
types: contracts changed
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
java: [17]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: ${{ matrix.java }}
- name: Checkout Specmatic Kafka Repo
uses: actions/checkout@v4
with:
repository: znsio/specmatic-kafka
path: specmatic-kafka
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- name: Grant execute permission for gradlew
working-directory: specmatic-kafka
run: chmod +x gradlew
- name: Publish Specmatic Kafka to Local Maven Repo
working-directory: specmatic-kafka
run: ./gradlew publishToMavenLocal
- name: Grant execute permission for gradlew on BFF repo
run: chmod +x gradlew
- name: Build BFF project with Gradle
run: ./gradlew build
- name: Run coverage report
run: ./gradlew jacocoTestReport
- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv
if: matrix.os == 'ubuntu-latest'
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"