Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,37 @@ jobs:
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'

- name: Install the official W3C EPUBCheck validator
run: |
curl --fail --location --silent --show-error \
https://github.com/w3c/epubcheck/releases/download/v5.3.0/epubcheck-5.3.0.zip \
--output "$RUNNER_TEMP/epubcheck.zip"
ditto -x -k "$RUNNER_TEMP/epubcheck.zip" "$RUNNER_TEMP"

- name: Build the Apple XCFramework
run: scripts/package-swift-xcframework.sh "$RUNNER_TEMP/mdi-swift"

- name: Test Swift binding with coverage
env:
MDI_SWIFT_SMOKE_OUTPUT: ${{ runner.temp }}/swift-package-smoke
run: |
mkdir -p swift/Artifacts
ditto "$RUNNER_TEMP/mdi-swift/MDICore.xcframework" swift/Artifacts/MDICore.xcframework
scripts/write-swift-package-manifest.sh local "swift/Artifacts/MDICore.xcframework"
swift test --enable-code-coverage
scripts/export-swift-coverage.sh swift/coverage.lcov

- name: Open and validate every Swift package format
run: >-
scripts/verify-swift-package-formats.sh
"$RUNNER_TEMP/swift-package-smoke"
"$RUNNER_TEMP/epubcheck-5.3.0/epubcheck.jar"

- name: Upload Swift coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
- python/**
- mdi-core/**
- .github/workflows/python.yml
- .github/workflows/release-pypi.yml
pull_request:
paths:
- python/**
- mdi-core/**
- .github/workflows/python.yml
- .github/workflows/release-pypi.yml

jobs:
test:
Expand All @@ -35,6 +37,22 @@ jobs:
cache: pip
cache-dependency-path: python/pyproject.toml

- uses: actions/setup-java@v4
if: matrix.python-version == '3.14'
with:
distribution: temurin
java-version: "21"

- uses: actions/setup-dotnet@v4
if: matrix.python-version == '3.14'
with:
dotnet-version: "8.0.x"

- uses: actions/setup-node@v4
if: matrix.python-version == '3.14'
with:
node-version: "22"

- name: Build the native extension and install test dependencies
run: python -m pip install -e '.[test]'

Expand All @@ -43,6 +61,61 @@ jobs:
- name: Run public API tests with coverage gate
run: python -m pytest --cov=mdi --cov-branch --cov-report=term-missing --cov-report=xml

- name: Install authoritative publication-format consumers
if: matrix.python-version == '3.14'
working-directory: ${{ github.workspace }}
run: |
sudo apt-get update
sudo apt-get install --yes libreoffice-writer
curl --fail --location --silent --show-error \
https://github.com/w3c/epubcheck/releases/download/v5.3.0/epubcheck-5.3.0.zip \
--output "$RUNNER_TEMP/epubcheck.zip"
unzip -q "$RUNNER_TEMP/epubcheck.zip" -d "$RUNNER_TEMP"
npm install --prefix "$RUNNER_TEMP/vnu" --no-save vnu-jar@25.12.31

- name: Generate every public Python format
if: matrix.python-version == '3.14'
working-directory: ${{ github.workspace }}
run: |
python python/tests/test_package_smoke.py \
--output-dir "$RUNNER_TEMP/python-package-smoke"

- name: Validate HTML with the Nu Html Checker
if: matrix.python-version == '3.14'
working-directory: ${{ github.workspace }}
run: |
java -jar \
"$RUNNER_TEMP/vnu/node_modules/vnu-jar/build/dist/vnu.jar" \
--errors-only "$RUNNER_TEMP/python-package-smoke/smoke.html"

- name: Validate EPUB with the official W3C EPUBCheck
if: matrix.python-version == '3.14'
working-directory: ${{ github.workspace }}
run: |
java -jar "$RUNNER_TEMP/epubcheck-5.3.0/epubcheck.jar" \
"$RUNNER_TEMP/python-package-smoke/smoke.epub"

- name: Validate DOCX with the Open XML SDK
if: matrix.python-version == '3.14'
working-directory: ${{ github.workspace }}
run: |
dotnet run \
--project nodejs/format-contracts/openxml-validator/OpenXmlValidator.csproj \
-- "$RUNNER_TEMP/python-package-smoke/smoke.docx"

- name: Open DOCX with LibreOffice Writer
if: matrix.python-version == '3.14'
working-directory: ${{ github.workspace }}
run: |
mkdir -p "$RUNNER_TEMP/libreoffice-output"
soffice \
"-env:UserInstallation=file://$RUNNER_TEMP/libreoffice-profile" \
--headless \
--convert-to pdf \
--outdir "$RUNNER_TEMP/libreoffice-output" \
"$RUNNER_TEMP/python-package-smoke/smoke.docx"
test -s "$RUNNER_TEMP/libreoffice-output/smoke.pdf"

- name: Upload Python coverage
if: matrix.python-version == '3.14'
uses: actions/upload-artifact@v4
Expand Down
Loading
Loading