Repository navigation
231 lines (200 loc) · 7.3 KB
/
Copy pathbuild.yml
File metadata and controls
231 lines (200 loc) · 7.3 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
name: Simple build and test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
env:
# The docling-serve image is large; pulling it can exceed Testcontainers' default 120s pull timeout
TESTCONTAINERS_PULL_TIMEOUT: 600
permissions:
contents: write
pull-requests: write
jobs:
save-pr-info:
runs-on: ubuntu-latest
if: always() && (github.event_name == 'pull_request')
needs: jvm-build-test
steps:
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.pull_request.number }} > ./pr/number
echo ${{ github.event.pull_request.head.sha }} > ./pr/sha
- name: Upload PR metadata
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: pr-metadata
path: pr/
retention-days: 7
jvm-build-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java:
- 17
- 21
- 25
- 27
module:
- docling-serve-api
- docling-serve-client
- docling-testcontainers
- docling-version-tests
name: jvm-build-test-${{ matrix.module }}-java${{ matrix.java }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Reclaim disk space
working-directory: .github
shell: bash
run: scripts/ci-reclaim-disk-space.sh
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: ${{ matrix.java }}
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: build-test-${{ matrix.module }}-java${{ matrix.java }}
run: |
./gradlew --no-daemon -Pjava.version=${{ matrix.java }} \
:${{ matrix.module }}:clean :${{ matrix.module }}:build
native-tests:
runs-on: ubuntu-latest
needs: jvm-build-test
if: github.event_name == 'pull_request'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
jackson:
- 2
- 3
name: native-tests-jackson${{ matrix.jackson }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Reclaim disk space
working-directory: .github
shell: bash
run: scripts/ci-reclaim-disk-space.sh
- name: Set up GraalVM
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: '25'
distribution: graalvm
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Test Jackson ${{ matrix.jackson }} on JVM and Native Image
run: |
./gradlew --no-daemon -Pjava.version=25 \
-PnativeTestJacksonVersion=${{ matrix.jackson }} \
:docling-native-tests:test :docling-native-tests:nativeRun \
:docling-native-tests:nativeClientTest
prepare-test-reports:
runs-on: ubuntu-latest
if: always() && (github.event_name == 'pull_request' || github.event_name == 'push')
strategy:
fail-fast: false
matrix:
java:
- 17
- 21
- 25
- 27
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Reclaim disk space
working-directory: .github/scripts
shell: bash
run: ./ci-reclaim-disk-space.sh
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: ${{ matrix.java }}
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Create aggregated test report
run: |
./gradlew --no-daemon -Pjava.version=${{ matrix.java }} :test-report-aggregation:check && \
mkdir -p test-report-aggregation/build/reports/tests/junitXml && \
find . -path '*/build/test-results/test/*.xml' -exec cp {} test-report-aggregation/build/reports/tests/junitXml \;
- name: Upload coverage to Codecov
if: github.repository == 'docling-project/docling-java' && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
report_type: coverage
files: ./test-report-aggregation/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
flags: java${{ matrix.java }}
name: codecov-java${{ matrix.java }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
- name: Upload test results to Codecov
if: github.repository == 'docling-project/docling-java' && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
report_type: test_results
directory: ./test-report-aggregation/build/reports/tests/junitXml
flags: java${{ matrix.java }}
name: tests-java${{ matrix.java }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Prepare build reports
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: build-reports-java${{ matrix.java }}-${{ github.run_attempt }}
path: |
**/build/test-results/**/*.xml
test-report-aggregation/build/reports/tests/test/aggregated-results/**
test-report-aggregation/build/reports/jacoco/testCodeCoverageReport/**
retention-days: 7
docs:
runs-on: ubuntu-latest
name: build-docs-pr
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Reclaim disk space
working-directory: .github/scripts
shell: bash
run: ./ci-reclaim-disk-space.sh
- name: Setup Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.x'
- name: Setup Java 25
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: 25
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Generate documentation
env:
IS_PR_BUILD: true
run: ./gradlew --console=plain clean :docs:build