This directory contains CI/CD workflows, utility scripts, and infrastructure tests for the TileGym repository.
Main CI workflow - Builds Docker images and runs tests.
Jobs:
config- Parses PR body for CI configuration optionsbuild- BuildstilegymDocker image and pushes to GHCRtest-ops- Runs ops tests (pytest -s tests/ops)test-benchmark- Runs benchmark tests sequentially (tests/benchmark/run_all.sh)
Scripts used:
scripts/parse_pr_config.py- Parse PR body configscripts/check_image_exists.py- Skip nightly builds if tests already passed
Test Results:
- ops-test-results: JUnit XML + HTML report with test pass/fail status (visible in "Checks" tab)
- benchmark-results: Individual
*_results.txtfiles containing performance tables with TFLOPS/GBps metrics for each benchmark (downloadable artifacts) - Benchmark summary: Formatted markdown tables visible in the workflow "Summary" tab
Infrastructure validation - Ensures code quality and validates CI scripts.
Jobs:
python-formatting- Runsdarkerwithisortfor incremental formatting checksutility-scripts-tests- Runs pytest on all infrastructure tests
Triggers: Push to main, push to pull-request/* branches
Tests:
- All utility scripts in
scripts/
GHCR maintenance - Cleans up old Docker images to save storage.
Jobs:
cleanup- Deletes stale PR images and untracked images
Triggers: Daily at 2 AM UTC, manual
Scripts used:
scripts/cleanup_stale_images.py- Delete closed PR and untracked images
Cleanup rules:
- Images for closed PRs (
pr-*tags) - Untracked images (no
pr-*,latest, or-verifiedtags, older than 7 days) - Verified images (
*-verifiedtags) are kept indefinitely
Located in scripts/, these Python utilities are used by workflows:
parse_pr_config.py- Extract CI configuration from PR descriptionscheck_image_exists.py- Check if Docker images exist in GHCRcleanup_stale_images.py- Delete stale Docker images from GHCRformat_benchmark_summary.py- Parse benchmark results and format as markdown tables for GitHub Actions summaryutils.py- Shared utilities (GitHub token, API headers, outputs)
All scripts have comprehensive docstrings and are fully tested.
Located in infra_tests/, these pytest-based tests validate all CI scripts including:
- PR config parsing logic
- Image existence checks and latest tag validation
- Image cleanup logic (verified tag preservation, untracked image detection)
- Shared utility functions
Run locally:
pytest .github/infra_tests/ -vTests are independent of the main TileGym package (no torch/CUDA dependencies).
Test results: Available in GitHub Actions UI under "Checks" tab and as downloadable artifacts (infra-test-results).
Control CI behavior by adding a YAML config block to your PR description:
config:
build: true
test: ["ops", "benchmark"]Options:
build: false- Skip build, pull latest from GHCRtest: ["ops"]- Run only ops teststest: []- Skip all tests
See .github/pull_request_template.md for the full template.
Nightly images: ghcr.io/<owner>/tilegym:<SHA>, nightly-<DATETIME>
Verified images: ghcr.io/<owner>/tilegym:<SHA>-verified (permanent proof tests passed)
Latest verified: ghcr.io/<owner>/tilegym:latest (points to newest passing build)
Tagging strategy:
- Build pushes:
<SHA>,nightly-<DATETIME> - After tests pass:
latestand<SHA>-verifiedtags are added latestmoves to newest passing build<SHA>-verifiedis permanent (useful for auditing and rollbacks)- Nightly builds skip if
latestalready points to current SHA