Compare commits
1 Commits
firmware_d
...
ad39e86a9d
| Author | SHA1 | Date | |
|---|---|---|---|
| ad39e86a9d |
@@ -1,12 +1,12 @@
|
|||||||
name: Deploy firmware via FTP (master)
|
name: Deploy firmware via FTP (main)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: deploy-master
|
group: deploy-main
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
import re
|
|
||||||
import unittest
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
class DeployWorkflowTests(unittest.TestCase):
|
|
||||||
def test_deploy_workflow_triggers_on_master_pushes(self):
|
|
||||||
workflow_path = Path(__file__).resolve().parents[1] / ".gitea" / "workflows" / "deploy-ftp.yml"
|
|
||||||
workflow_text = workflow_path.read_text(encoding="utf-8")
|
|
||||||
|
|
||||||
branch_block_match = re.search(
|
|
||||||
r"on:\s*\n\s*push:\s*\n\s*branches:\s*\n(?P<branches>(?:\s*-\s*[^\n]+\n)+)",
|
|
||||||
workflow_text,
|
|
||||||
)
|
|
||||||
|
|
||||||
self.assertIsNotNone(branch_block_match, "workflow should define push branches")
|
|
||||||
branches = re.findall(r"-\s*([^\n]+)", branch_block_match.group("branches"))
|
|
||||||
|
|
||||||
self.assertEqual(branches, ["master"])
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
|
||||||
Reference in New Issue
Block a user