stackchain-dashboard/tests/test_ci_workflow.py
timmy 2cb92811c9
All checks were successful
CI / lint (pull_request) Successful in 33s
CI / build-release (pull_request) Successful in 4s
CI / release-candidate (pull_request) Has been skipped
ci: gate RCs on verifiable artifacts (#339)
2026-08-08 20:35:52 +00:00

29 lines
974 B
Python

from pathlib import Path
WORKFLOW = Path(".gitea/workflows/ci.yml")
def test_ci_uses_gitea_compatible_artifact_action():
text = WORKFLOW.read_text()
assert "actions/upload-artifact@v4" not in text
assert "actions/upload-artifact@v3" in text
def test_ci_installs_declared_requirements_before_tests():
text = WORKFLOW.read_text()
install = text.index("pip install -r requirements.txt")
tests = text.index("python3 -m pytest tests/ -q")
assert install < tests
def test_release_promotion_waits_for_tests_and_bundle():
text = WORKFLOW.read_text()
release = text[text.index(" release-candidate:") :]
assert "needs: [lint, build-release]" in release
assert "github.event_name == 'push'" in release
assert "actions/download-artifact@v3" in release
assert 'python3 scripts/verify_release.py --input-dir dist --commit "$TARGET"' in release
assert release.index("sha256sum -c") < release.index("curl --fail-with-body")