-
Notifications
You must be signed in to change notification settings - Fork 103
150 lines (144 loc) · 5.06 KB
/
pull_request.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Pull Request
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
# Three parallel jobs:
# 1. style: Runs all checks on the build (including compilation static analysis) except the tests
# This allows us to catch anything related to build and style faster, as we don't have to wait
# on tests to complete. It also allows the test jobs to continue even if there's a style failure.
# 2. core-tests: Runs the fdb-record-layer-core tests. This is the longest test suite of the
# various subprojects, so separating it out allows us to speed up the PRB time.
# 3. other-tests: Runs the rest of the tests. This tests everything else
# 4. coverage: Merges the JaCoCo output of 2 and 3 and generates reports.
style:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- name: Checkout sources
uses: actions/[email protected]
- name: Setup Base Environment
uses: ./actions/setup-base-env
- name: Run Gradle Build
uses: ./actions/run-gradle
with:
gradle_command: build -x test -x destructiveTest -PreleaseBuild=false -PpublishBuild=false -PspotbugsEnableHtmlReport
core-tests:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- name: Checkout sources
uses: actions/[email protected]
- name: Setup Base Environment
uses: ./actions/setup-base-env
- name: Setup FDB
uses: ./actions/setup-fdb
- name: Run Gradle Test
uses: ./actions/gradle-test
with:
gradle_command: :fdb-record-layer-core:test :fdb-record-layer-core:destructiveTest
gradle_args: -PreleaseBuild=false -PpublishBuild=false
- name: Publish Test Reports
if: always()
uses: actions/[email protected]
with:
name: core-test-reports
path: |
test-reports/fdb-record-layer-core/
- name: Publish Coverage Data
uses: actions/[email protected]
with:
name: core-coverage-data
path: |
**/.out/jacoco/*.exec
include-hidden-files: true
retention-days: 1
other-tests:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- name: Checkout sources
uses: actions/[email protected]
- name: Setup Base Environment
uses: ./actions/setup-base-env
- name: Setup FDB
uses: ./actions/setup-fdb
- name: Run Gradle Test
uses: ./actions/gradle-test
with:
gradle_command: test -x :fdb-record-layer-core:test destructiveTest -x :fdb-record-layer-core:destructiveTest
gradle_args: -PreleaseBuild=false -PpublishBuild=false
- name: Publish Test Reports
if: always()
uses: actions/[email protected]
with:
name: other-test-reports
path: |
test-reports/fdb-java-annotations/
test-reports/fdb-extensions/
test-reports/fdb-record-layer-icu/
test-reports/fdb-record-layer-spatial/
test-reports/fdb-record-layer-lucene/
test-reports/fdb-record-layer-jmh/
test-reports/examples/
test-reports/fdb-relational-api/
test-reports/fdb-relational-core/
test-reports/fdb-relational-cli/
test-reports/fdb-relational-grpc/
test-reports/fdb-relational-jdbc/
test-reports/fdb-relational-server/
test-reports/yaml-tests/
- name: Publish Coverage Data
uses: actions/[email protected]
with:
name: other-coverage-data
path: |
**/.out/jacoco/*.exec
**/.out/libs/*.jar
include-hidden-files: true
retention-days: 1
coverage:
needs: [core-tests, other-tests]
runs-on: ubuntu-latest
permissions:
checks: read
contents: read
steps:
- name: Checkout HEAD sources
uses: actions/[email protected]
- name: Setup Base Environment
uses: ./actions/setup-base-env
- name: 'Download artifacts'
uses: actions/download-artifact@v4
with:
pattern: |
*-coverage-data
merge-multiple: true
- name: Run JaCoCo Report
uses: ./actions/run-gradle
with:
gradle_command: codeCoverageReport
- name: Publish Coverage Report
uses: actions/[email protected]
with:
name: coverage-report
path: |
${{ github.workspace }}/.out/reports/jacoco/codeCoverageReport/
- name: Add Coverage Summary
uses: madrapps/jacoco-report@e4bbaf00a0b8920cb86a448ae3ec0fc6f6bfeacc
with:
paths: |
${{ github.workspace }}/.out/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
comment-type: summary
min-coverage-overall: 75
min-coverage-changed-files: 80