-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 2.2 KB
/
ci.yml
File metadata and controls
69 lines (60 loc) · 2.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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5
with:
gradle-home-cache-cleanup: true
# Configuration cache occasionally trips up the Vanniktech publish
# plugin's property-driven configuration — keep CI off it.
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Build and test
# `build` runs compileJava + compileTestJava + test on every subproject.
# `jacocoTestReport` is wired in each module's build.gradle.kts but
# repeating it here makes the dependency explicit for the next step.
run: ./gradlew build jacocoTestReport --no-configuration-cache --stacktrace
- name: Upload coverage to Codecov
if: success() && github.event_name == 'push'
uses: codecov/codecov-action@v6
with:
# Glob across all subprojects so adding a future module (e.g.
# api-log-jdbc) picks up its coverage report without another edit.
files: |
./core/build/reports/jacoco/test/jacocoTestReport.xml
./jpa/build/reports/jacoco/test/jacocoTestReport.xml
./r2dbc/build/reports/jacoco/test/jacocoTestReport.xml
./mybatis/build/reports/jacoco/test/jacocoTestReport.xml
flags: unittests
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test reports on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: test-reports
# `**` so any future module's reports are also captured.
path: |
**/build/reports/tests/
**/build/test-results/
**/build/reports/jacoco/
retention-days: 7