🐛 fix(ci): inline gitea workflow bootstrap
remove the pre-checkout dependency on .gitea/ci/prepare_repo.sh from the root workflows and inline the bootstrap logic instead. add a regression test for workflow bootstrap ordering and register it in the tests README.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
TEST_WORKFLOW = ROOT / ".gitea" / "workflows" / "test.yml"
|
||||
STANDARDS_WORKFLOW = ROOT / ".gitea" / "workflows" / "standards-check.yml"
|
||||
|
||||
|
||||
class GiteaWorkflowBootstrapTests(unittest.TestCase):
|
||||
def test_repo_workflows_do_not_call_repo_local_prepare_script_before_checkout(self):
|
||||
for workflow in (TEST_WORKFLOW, STANDARDS_WORKFLOW):
|
||||
text = workflow.read_text(encoding="utf-8")
|
||||
with self.subTest(workflow=workflow.name):
|
||||
self.assertNotIn("bash .gitea/ci/prepare_repo.sh", text)
|
||||
self.assertIn('REPO_DIR="${WORKSPACE_DIR}/${REPO_NAME}"', text)
|
||||
self.assertIn('git clone "$REPO_URL" "$REPO_DIR"', text)
|
||||
self.assertIn('echo "REPO_DIR=$REPO_DIR" >> "$GITHUB_ENV"', text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user