Dorde/task/align GitHub workflows - #58
Merged
Merged
Conversation
The develop branch is gone, so CI runs on master instead: - Remove develop.yml - Add master.yml running spotlessCheck, unit tests and instrumented tests on push to master - Reshape pr-checks.yml to match scan-engine - Trigger releases from version tags instead of pushes to master, and verify the tag matches the print-engine version in libs.versions.toml Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates CI/release automation for the Tillhub Print Engine repository by aligning GitHub Actions workflows (PR checks, master-branch CI, and release publishing), and also adjusts Maven publishing POM metadata.
Changes:
- Switch release publishing workflow to run on version tags and add a guard to ensure the pushed tag matches
gradle/libs.versions.toml. - Reformat/rename the PR checks workflow job for cleaner YAML structure.
- Add a new
masterbranch CI workflow and remove thedevelopbranch workflow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
print-engine/build.gradle.kts |
Removes two developer entries from Maven POM metadata. |
.github/workflows/release.yml |
Triggers publishing on tags and adds a “tag matches version” verification step. |
.github/workflows/pr-checks.yml |
YAML cleanup and job renaming for PR CI checks. |
.github/workflows/master.yml |
New master-branch CI that runs lint/unit tests + connected Android tests. |
.github/workflows/develop.yml |
Removes develop-branch CI workflow (no longer runs on develop pushes). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| push: | ||
| branches: [ "master" ] | ||
| tags: | ||
| - '[0-9]+.[0-9]+.[0-9]+' |
Comment on lines
+21
to
+25
| VERSION=$(grep -m1 '^print-engine = ' gradle/libs.versions.toml | cut -d'"' -f2) | ||
| if [ "${GITHUB_REF_NAME}" != "${VERSION}" ]; then | ||
| echo "Tag ${GITHUB_REF_NAME} does not match libs.versions.toml version ${VERSION}" | ||
| exit 1 | ||
| fi |
Comment on lines
144
to
151
| // Specify developers information | ||
| developers { | ||
| developer { | ||
| id.set("djordjeh") | ||
| name.set("Đorđe Hrnjez") | ||
| email.set("dorde.hrnjez@unzer.com") | ||
| } | ||
| developer { | ||
| id.set("SloInfinity") | ||
| name.set("Martin Sirok") | ||
| email.set("m.sirok.ext@unzer.com") | ||
| } | ||
| developer { | ||
| id.set("shekar-allam") | ||
| name.set("Chandrashekar Allam") | ||
| email.set("chandrashekar.allam@unzer.com") | ||
| } | ||
| } |
Comment on lines
+3
to
+6
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
|
|
Receipts silently failed to print on PAX and Verifone when a header or footer image was large. Those printers inline every image into the receipt HTML as base64 and hand the whole string to the vendor service in one Binder transaction, capped at ~1 MB per process. Nothing on that path normalised the image, and a failed transaction was never reported back to the caller. - Normalise images in the HTML path: downscale to the print head width (never upscaling) and dither to 1 bit monochrome before encoding. The head cannot render colour or detail beyond its own width, so nothing printable is lost. Barcodes and QR codes are generated for the target printer and already monochrome, so they skip normalisation - rescaling them would only risk their scannability. - Expose the print head width on PrintingPaperSpec, so the target width comes from the device rather than a constant hardcoded per app. - Surface transport failures: the PAX and Verifone print paths reported them only through the printer state, so startPrintJob returned Success for a receipt that was never printed. Both now rethrow, and withPrinterCatching turns them into a PrinterResult.Error. - Use Base64.NO_WRAP on Android: DEFAULT inserts CRLF every 76 characters, ~2.7% of waste inside a data URI, and iOS never wrapped. The pixel work lives in commonMain as plain IntArray operations, so the whole algorithm is shared and unit tested through MonochromeImage. normalize; only building a bitmap from pixels is expect/actual (Android Bitmap, Skia on iOS). Native plugins are untouched - Epson, Star and Sunmi already normalise inside their vendor SDKs and must not be processed twice. The payload size guard the ticket also asks for is deliberately left out: any byte budget would be a guess until it is measured on a real PAX and Verifone, and a wrong one would reject receipts that print fine today. Bumps the version to 3.1.0 for release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Gives the header/footer image path something to exercise on a real device: apex.png as the header, photoshoppng.png as the footer. The latter is 2000x1400 at 233 KB, close to the image size that triggered UNTIL-21656, so it covers the downscale path rather than only the dither. The print job moves out of the companion object, since decoding a drawable needs resources. The drawables sit in drawable-nodpi so they are decoded at their authored pixel size instead of being density scaled for the screen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.