ci: unify check and production deploy into one workflow
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
bfbc02c75d
commit
3e584aadaf
4 files changed
+502
-483
No files matched your search
@@ -14,10 +14,22 @@ function toContainLiteral(workflow: string, literal: string) {
|
||||
|
||||
describe("production deploy workflow", () => {
|
||||
const workflow = readFileSync(
|
||||
resolve(process.cwd(), ".gitea/workflows/deploy.yaml"),
|
||||
resolve(process.cwd(), ".gitea/workflows/ci.yaml"),
|
||||
"utf8",
|
||||
);
|
||||
const deployJob = workflow.slice(workflow.indexOf("\n deploy:"));
|
||||
const deployStart = workflow.indexOf("\n deploy:");
|
||||
const afterDeploy = workflow.indexOf("\n release:", deployStart + 1);
|
||||
const deployJob =
|
||||
afterDeploy > deployStart
|
||||
? workflow.slice(deployStart, afterDeploy)
|
||||
: workflow.slice(deployStart);
|
||||
|
||||
it("is gated behind the check job", () => {
|
||||
expect(deployJob).toContain("needs: check");
|
||||
expect(deployJob).toContain(
|
||||
"gitea.event_name == 'push' && gitea.ref_name == 'main'",
|
||||
);
|
||||
});
|
||||
|
||||
it("builds in a stage worktree while preserving live .env and storage", () => {
|
||||
expect(deployJob).toContain("worktree add --detach");
|
||||
|
||||
Reference in new issue
Block a user