Improve CI Workflow#887
Open
Symmetricity wants to merge 4 commits into
Open
Conversation
Update the workflow defaults before adding deeper output checks. This adds explicit workflow permissions, run cancellation, shared fixture download and verification, newer GitHub Actions versions, runner-scoped vcpkg binary caches, and Docker build caching. This reduces duplicated work across jobs, avoids using an unchecked PBF download independently on each runner, makes cache reuse less brittle across runner image changes, and keeps PR Docker builds separate from master publishes.
Generate MBTiles and PMTiles artifacts from each CI build path, run the generation twice, and compare the results after the build jobs complete. The verification step checks PMTiles archive structure, records raw decompressed tile-byte hashes, and also canonicalizes MVT layer, feature, and tag ordering so ordering-only changes are reported separately from semantic tile-content differences. This turns CI into a correctness check for generated output, not just a compiler check. Current runs show that the new check is finding real issues: Windows PMTiles archives fail structural verification, and repeat runs can produce semantic differences such as different feature counts in the same layer/tile. Because this adds a Python CI helper, ignore Python bytecode and cache directories produced by local validation.
Decode MVT geometry before calculating semantic hashes so equivalent point ordering and polygon ring rotation do not fail CI as content changes. Keep the published Docker action output in repeat-output checks, but exclude it from cross-runner comparisons because that action uses the ghcr.io master image rather than the PR-built binaries.
fd48625 to
57b1c31
Compare
Open
CI generated tile artifacts can otherwise be incomplete when one tilemaker invocation fails but a later command in the same step succeeds. This made the Windows CMake job upload only three of the four expected tile files while the job itself still passed. Wrap direct tilemaker calls so each output is checked immediately, and verify generated files before artifact upload. This makes the failing output visible at the generation step instead of deferring the problem to the verifier or silently uploading partial artifacts.
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.
Improve CI Workflow
This PR was AI generated.
Summary
This updates the GitHub Actions CI workflow so it is faster, less repetitive,
and checks more than whether tilemaker compiles.
with build jobs as an artifact
vcpkg tree directly
masterpublishesexpected output archive
pmtiles verifypoint ordering and polygon ring rotation while preserving polygon ring
grouping
treating it as a cross-runner reference for PR-built binaries
Rationale
The old workflow downloaded the same PBF independently in several jobs and only
verified that the build commands completed. That made CI slower than necessary
and left important runtime behavior unchecked.
The shared fixture job makes every build use the same input file and verifies
the Geofabrik
.md5before the fixture is used. If Geofabrik is unavailable orthe checksum does not match, the workflow reports that tile generation was not
verified rather than making the failure look like a code regression.
The vcpkg cache now stores vcpkg binary packages and includes the GitHub runner
image identity in the key. That avoids blindly restoring an installed tree from
a different runner image while still allowing warm dependency restores on stable
runners. Docker builds also use the GitHub Actions build cache.
The generated tile verification exists because tilemaker's most important output
is the generated vector-tile archive. A build can compile cleanly while still
producing invalid PMTiles, non-repeatable tile content, or different content
between build paths. CI should catch those cases.
Each tilemaker invocation is now checked as soon as it returns. This avoids
multi-command CI steps masking a failed archive generation when a later command
succeeds, and it makes the failing output visible in the generation job rather
than later as a missing artifact or verifier failure.
Output verification
The new verifier checks two levels of output equality:
removing archive compression noise
order before comparing. It also decodes geometry command streams so equivalent
point ordering and polygon ring rotation do not fail as content changes, while
preserving polygon outer-ring and inner-ring grouping.
Raw byte differences with identical semantic content are reported as notices.
Semantic tile-content differences fail the job and include the first differing
tile. When the layer feature counts differ, the error also reports the affected
layer and counts.
PMTiles archives are also checked with
pmtiles verifybefore their tile contentis compared. The PMTiles verifier output is included in the GitHub annotation so
the failure is visible in the web UI without digging through raw logs.
The GitHub Action job is still generated and checked for repeatability, but it
uses the published
ghcr.io/systemed/tilemaker:masterDocker image. Becausethat is not necessarily the same binary as the PR-built CMake and Makefile
outputs, the verifier excludes that artifact from cross-runner equivalence
checks.
Current findings
The verifier was run locally against artifacts downloaded from fork CI runs.
Those tests showed that the new check is catching real output issues, not just
formatting or compression differences:
mismatch reported by
pmtiles verify.where the same tile/layer had different feature counts, such as
poihaving102features in one run and101in the repeat run.verifier now separates raw-byte mismatches from semantic MVT mismatches.
feature geometry; the verifier now normalizes those before calculating
semantic hashes.
job produced only three of the four expected archives. The workflow now fails
at the tile generation step if an expected archive is missing or empty.
These findings are not fixed by this PR. This PR adds CI coverage that exposes
them consistently.
Related issues and PRs
This PR does not include the build-fix changes from #886. If
masterstill hasthose build failures when this PR is tested, this PR should be applied after
#886 or rebased once equivalent fixes land.
Directly related:
code/build-system fixes separate.
boost_systemlinker failures; covered byFix Build Issues #886, not this PR.
uintportability failures; covered by Fix Build Issues #886, not this PR.This PR may improve future detection and debugging for output-related issues,
but does not claim to fix them:
No directly relevant GitHub Discussions were found for deterministic generated
tile output checks.
Testing
actionlint .github/workflows/ci.ymlpython3 -B -c 'import py_compile; py_compile.compile(".github/scripts/verify-generated-tiles.py", cfile="/tmp/verify-generated-tiles.pyc", doraise=True)'git diff --checkThe clean branch currently contains only CI-related files:
.github/workflows/ci.yml.github/scripts/verify-generated-tiles.py.gitignore