Skip to content

Version tests

Version tests #24

Workflow file for this run

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: 4
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
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/checkout@v6
- 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 || '4' }}" >> $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
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
cache: gradle
- name: Build version tester
run: ./gradlew --no-daemon -Pjava.version=${{ env.JAVA_VERSION }} :docling-version-tests:build
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.DOCLING_JAVA_CI_APP_ID }}
private-key: ${{ secrets.DOCLING_JAVA_CI_PRIVATE_KEY }}
- 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 }} \
--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: Create docs PR
id: create-pr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.app-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.app-token.outputs.token }}
run: gh pr merge --merge --admin --delete-branch "${{ steps.create-pr.outputs.pull-request-url }}"