Repository navigation
208 lines (184 loc) · 8.58 KB
/
Copy pathversion-tests.yml
File metadata and controls
208 lines (184 loc) · 8.58 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
name: Version tests
env:
JAVA_VERSION: 25
on:
schedule:
- cron: '0 3 * * 1' # Every Monday at 4 AM UTC
workflow_dispatch:
inputs:
parallelism:
description: The number of versions to verify in parallel
required: false
type: number
default: '2'
image:
description: The docling-serve image to fetch
required: true
type: string
default: docling-project/docling-serve
registry:
description: The registry to fetch the image from
required: true
type: string
default: ghcr.io
outputDir:
description: The output directory to write the results to
required: true
type: string
default: results
tags:
description: |
The tags to test (comma separated).
If blank, list of tags will be fetched dynamically
required: false
type: string
excludeTagsRegex:
description: A regex to exclude tags from testing. Tags matching this regex will be excluded.
required: false
type: string
default: '^v0.*'
createGithubIssue:
description: Create a GitHub issue if any of the tests fail
required: true
type: boolean
default: true
updateDefaultImage:
description: Open a PR bumping the default docling-serve image version to the newest passing tag
required: true
type: boolean
default: true
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
permissions:
actions: read
contents: write
issues: write
pull-requests: write
jobs:
versions-tests:
runs-on: ubuntu-latest
if: github.repository == 'docling-project/docling-java'
steps:
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: app-token
with:
app-id: ${{ vars.DOCLING_JAVA_CI_APP_ID }}
private-key: ${{ secrets.DOCLING_JAVA_CI_PRIVATE_KEY }}
permission-actions: read
permission-contents: write
permission-issues: write
permission-pull-requests: write
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Reclaim disk space
working-directory: .github/scripts
shell: bash
run: ./ci-reclaim-disk-space.sh
- name: Process tags and flags
run: |
INPUT="${{ inputs.tags }}"
TAGS=${INPUT:+$(echo "$INPUT" | tr -d ' ' | sed 's/,/ -t /g' | sed 's/^/-t /')}
echo "TAGS=$TAGS" >> $GITHUB_ENV
CREATE_GITHUB_ISSUE_FLAG="--create-github-issue"
if [ "${{ inputs.createGithubIssue }}" == "false" ]; then
CREATE_GITHUB_ISSUE_FLAG="--no-create-github-issue"
fi
echo "CREATE_GITHUB_ISSUE_FLAG=$CREATE_GITHUB_ISSUE_FLAG" >> $GITHUB_ENV
# Set defaults for scheduled runs
echo "PARALLELISM=${{ inputs.parallelism || '2' }}" >> $GITHUB_ENV
echo "IMAGE=${{ inputs.image || 'docling-project/docling-serve' }}" >> $GITHUB_ENV
echo "REGISTRY=${{ inputs.registry || 'ghcr.io' }}" >> $GITHUB_ENV
echo "OUTPUT_DIR=${{ inputs.outputDir || 'results' }}" >> $GITHUB_ENV
echo "EXCLUDE_TAGS_REGEX=${{ inputs.excludeTagsRegex || '^v0.*' }}" >> $GITHUB_ENV
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Build version tester
run: ./gradlew --no-daemon -Pjava.version=${{ env.JAVA_VERSION }} :docling-version-tests:build
- name: Run version tester
working-directory: docling-testing/docling-version-tests
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
java -jar build/quarkus-app/quarkus-run.jar \
-p ${{ env.PARALLELISM }} \
-i ${{ env.IMAGE }} \
-r ${{ env.REGISTRY }} \
-o ${{ env.OUTPUT_DIR }} \
-e ${{ env.EXCLUDE_TAGS_REGEX }} \
--cleanup-container-images \
${{ env.TAGS }} ${{ env.CREATE_GITHUB_ISSUE_FLAG }}
- name: Copy output markdown to docs
id: copy-results
run: |
RESULTS_FILE="$(find docling-testing/docling-version-tests/${{ env.OUTPUT_DIR }} -name 'results.md' | sort | tail -n 1)"
echo "results-file=$RESULTS_FILE" >> "$GITHUB_OUTPUT"
cp "$RESULTS_FILE" docs/src/doc/docs/includes/docling-serve/serve-compatibility.md
- name: Generate fresh token for PR
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: pr-token
with:
app-id: ${{ vars.DOCLING_JAVA_CI_APP_ID }}
private-key: ${{ secrets.DOCLING_JAVA_CI_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Create docs PR
id: create-pr
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.pr-token.outputs.token }}
add-paths: docs/src/doc/docs/includes/docling-serve/serve-compatibility.md
commit-message: "docs: Update docling-serve compatibility table (from ${{ github.workflow }} run # ${{ github.run_number }})"
branch: update-serve-compatibility/sourceref
branch-suffix: short-commit-hash
delete-branch: true
base: main
signoff: true
sign-commits: true
title: "docs: Update docling-serve compatibility table (from ${{ github.workflow }} run # ${{ github.run_number }})"
body: "docs: Update docling-serve compatibility table from [${{ github.workflow }} run # ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}), which was triggered by commit ${{ env.REF }}."
labels: |
automation
documentation
area:docling-serve
- name: Merge PR
if: (steps.create-pr.outputs.pull-request-operation == 'created') && steps.create-pr.outputs.pull-request-number
env:
GH_TOKEN: ${{ steps.pr-token.outputs.token }}
run: gh pr merge --merge --admin --delete-branch "${{ steps.create-pr.outputs.pull-request-url }}"
- name: Bump default docling-serve image version
id: bump-image
if: (inputs.updateDefaultImage != false) && (env.IMAGE == 'docling-project/docling-serve') && (env.REGISTRY == 'ghcr.io')
run: ./.github/scripts/docling-serve-image-bump.sh "${{ steps.copy-results.outputs.results-file }}"
- name: Create image bump PR
if: steps.bump-image.outputs.updated == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.pr-token.outputs.token }}
add-paths: docling-testcontainers/src/main/java/ai/docling/testcontainers/serve/config/DoclingServeContainerConfig.java
commit-message: "chore(testcontainers): bump default docling-serve image to ${{ steps.bump-image.outputs.new }}"
branch: update-docling-serve-image/${{ steps.bump-image.outputs.new }}
delete-branch: true
base: main
signoff: true
sign-commits: true
title: "chore(testcontainers): bump default docling-serve image to ${{ steps.bump-image.outputs.new }}"
body: |
Bumps the default docling-serve image version from `${{ steps.bump-image.outputs.current }}` to `${{ steps.bump-image.outputs.new }}`.
`${{ steps.bump-image.outputs.new }}` is the newest tag that passed the version tests in [${{ github.workflow }} run # ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}). See the [compatibility table](${{ github.server_url }}/${{ github.repository }}/blob/main/docs/src/doc/docs/includes/docling-serve/serve-compatibility.md).
Newer tags that did not pass: ${{ steps.bump-image.outputs.skipped || 'none' }}
labels: |
automation
version-upgrade
module:docling-testcontainers
area:docling-serve