Skip to content

Sync Apache PDFBox trunk through 1187c45 (#951) #1808

Sync Apache PDFBox trunk through 1187c45 (#951)

Sync Apache PDFBox trunk through 1187c45 (#951) #1808

Workflow file for this run

name: CI Build
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
PDFBOX_PARITY_GATE_MODE: ${{ vars.PDFBOX_PARITY_GATE_MODE || 'ratchet' }}
PDFBOX_PARITY_PDFBOX_REF: ${{ vars.PDFBOX_PARITY_PDFBOX_REF || '1187c45f9dcee38ed5ac12bc15df04913b348875' }}
PDFBOX_API_SURFACE_PDFBOX_REF: ${{ vars.PDFBOX_API_SURFACE_PDFBOX_REF || '1187c45f9dcee38ed5ac12bc15df04913b348875' }}
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Setup .NET
uses: actions/setup-dotnet@v6.0.0
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore PdfBoxNet.slnx
- name: Build
run: dotnet build PdfBoxNet.slnx --configuration Release --no-restore
- name: Test
run: dotnet test PdfBoxNet.slnx --configuration Release --no-build --nologo
- name: Checkout Apache PDFBox for API surface gate
uses: actions/checkout@v7.0.1
with:
repository: apache/pdfbox
ref: ${{ env.PDFBOX_API_SURFACE_PDFBOX_REF }}
path: apache-pdfbox-api
- name: API surface review gate
run: >
python3 tools/parity/generate_api_surface_report.py
--upstream-root apache-pdfbox-api
--no-build
--ratchet-baseline reports/api-surface-ratchet-baseline.json
--fail-on-unreviewed
- name: Runtime parity harness smoke
run: |
python3 -m py_compile tools/parity/runtime/run_runtime_parity.py
python3 tools/parity/runtime/run_runtime_parity.py --help
runtime-parity:
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: build-and-test
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Checkout Apache PDFBox
uses: actions/checkout@v7.0.1
with:
repository: apache/pdfbox
ref: ${{ env.PDFBOX_PARITY_PDFBOX_REF }}
path: apache-pdfbox
- name: Setup .NET
uses: actions/setup-dotnet@v6.0.0
with:
dotnet-version: 10.0.x
- name: Setup Java
uses: actions/setup-java@v5.6.0
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Build Apache PDFBox app jar
working-directory: apache-pdfbox
run: mvn -B -pl app -am -DskipTests package
- name: Restore runtime probe
run: dotnet restore tools/parity/runtime/DotnetPdfProbe/DotnetPdfProbe.csproj
- name: Runtime parity suite
run: >
python3 tools/parity/runtime/run_runtime_parity.py
--manifest tools/parity/runtime/corpus-manifest.txt
--pdfbox-root apache-pdfbox
--java-classpath apache-pdfbox/app/target/pdfbox-app-4.0.0-SNAPSHOT.jar
--out-dir artifacts/runtime-parity
--ratchet-baseline tools/parity/runtime/ratchet-baseline.json
--gate-mode "${PDFBOX_PARITY_GATE_MODE:-ratchet}"
--fail-on-unexpected
- name: Runtime parity summary
if: ${{ always() }}
run: |
if [ -f artifacts/runtime-parity/summary.md ]; then
cat artifacts/runtime-parity/summary.md
cat artifacts/runtime-parity/summary.md >> "$GITHUB_STEP_SUMMARY"
else
echo "Runtime parity summary was not generated."
fi
- name: Upload runtime parity artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
with:
name: runtime-parity-${{ github.run_id }}-${{ github.run_attempt }}
path: artifacts/runtime-parity