Repository navigation
169 lines (149 loc) · 6.37 KB
/
Copy pathversion-tests.yml
File metadata and controls
169 lines (149 loc) · 6.37 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
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
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@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
- 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
run: find docling-testing/docling-version-tests/${{ env.OUTPUT_DIR }} -name 'results.md' -exec cp -r '{}' 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 }}"