SHA256
ci: target Gitea Ubuntu and native Apple Silicon runners
Move workflows into Gitea's workflow directory and use the supplied ubuntu-latest and macos-arm64 labels. Provision the Android SDK, require KVM without changing host permissions, support SHA-256 checkout and Gitea artifact uploads, and isolate scratch output on persistent runners. Skip untrusted fork PRs and keep release builds unsigned because Gitea ignores GitHub environment approval gates. Local workflow lint, repository invariants, ten preflight regressions, eight evidence-verifier tests, inline shell checks, scratch cleanup and SHA-256 fetch checks pass; remote runner execution remains unverified.
This commit is contained in:
1 parent
2d12491516
commit
11bf4ca620
16 files changed
+442
-192
No files matched your search
@@ -47,8 +47,19 @@ network = ET.parse(ROOT / "android/app/src/main/res/xml/network_security_config.
|
||||
assert network.find("base-config").get("cleartextTrafficPermitted") == "false"
|
||||
assert [node.get("src") for node in network.findall(".//certificates")] == ["system"]
|
||||
assert "distributionSha256Sum=" in (ROOT / "android/gradle/wrapper/gradle-wrapper.properties").read_text()
|
||||
for workflow in (ROOT / ".github/workflows").glob("*.yml"):
|
||||
workflows = sorted((ROOT / ".gitea/workflows").glob("*.yml"))
|
||||
assert {path.name for path in workflows} == {"android.yml", "ios.yml", "release.yml"}, "Missing Gitea workflows"
|
||||
for workflow in workflows:
|
||||
for action in re.findall(r"uses:\s*([^\s#]+)", workflow.read_text()):
|
||||
assert re.fullmatch(r"[\w.-]+/[\w./-]+@[0-9a-f]{40}", action), f"Unpinned action: {action}"
|
||||
assert re.fullmatch(r"https://(?:github.com|gitea.com)/[\w.-]+/[\w./-]+@[0-9a-f]{40}", action), f"Unpinned action: {action}"
|
||||
expected_runner = "macos-arm64" if workflow.name == "ios.yml" else "ubuntu-latest"
|
||||
labels = re.findall(r"runs-on:\s*([^\s#]+)", workflow.read_text())
|
||||
assert labels and all(label == expected_runner for label in labels), f"Wrong runner in {workflow.name}"
|
||||
checkouts = workflow.read_text().count("https://github.com/actions/checkout@")
|
||||
assert checkouts == (2 if workflow.name == "android.yml" else 1), "Each job needs checkout"
|
||||
assert workflow.read_text().count("GIT_DEFAULT_HASH: sha256") == checkouts, "SHA-256 checkout must be explicit"
|
||||
assert workflow.read_text().count("persist-credentials: false") == checkouts, "Do not retain CI checkout tokens"
|
||||
release = (ROOT / ".gitea/workflows/release.yml").read_text()
|
||||
assert "secrets." not in release and "environment:" not in release, "Gitea signing needs a separately reviewed approval mechanism"
|
||||
assert "NSAllowsArbitraryLoads" not in (ROOT / "ios/project.yml").read_text()
|
||||
print(f"Repository invariants: {len(paths)} source/documentation paths checked.")
|
||||
Reference in new issue
Block a user