MCPcopy
hub / github.com/saltstack/salt / generate_workflows

Function generate_workflows

tools/precommit/workflows.py:105–213  ·  view source on GitHub ↗

Generate GitHub Actions Workflows

(ctx: Context)

Source from the content-addressed store, hash-verified

103 name="generate-workflows",
104)
105def generate_workflows(ctx: Context):
106 """
107 Generate GitHub Actions Workflows
108 """
109 workflows = {
110 "CI": {
111 "template": "ci.yml",
112 },
113 "Nightly": {
114 "template": "nightly.yml",
115 },
116 "Stage Release": {
117 "slug": "staging",
118 "template": "staging.yml",
119 "includes": {
120 "test-pkg-downloads": True,
121 },
122 },
123 "Scheduled": {
124 "template": "scheduled.yml",
125 },
126 }
127 test_salt_pkg_listing = TEST_SALT_PKG_LISTING
128
129 build_rpms_listing = []
130 rpm_os_versions: dict[str, list[str]] = {
131 "amazon": [],
132 "fedora": [],
133 "photon": [],
134 "redhat": [],
135 }
136 for slug in sorted(slugs()):
137 if slug.endswith("-arm64"):
138 continue
139 if not slug.startswith(("amazonlinux", "rockylinux", "fedora", "photonos")):
140 continue
141 os_name, os_version = slug.split("-")
142 if os_name == "amazonlinux":
143 rpm_os_versions["amazon"].append(os_version)
144 elif os_name == "photonos":
145 rpm_os_versions["photon"].append(os_version)
146 elif os_name == "fedora":
147 rpm_os_versions["fedora"].append(os_version)
148 else:
149 rpm_os_versions["redhat"].append(os_version)
150
151 for distro, releases in sorted(rpm_os_versions.items()):
152 for release in sorted(set(releases)):
153 for arch in ("x86_64", "arm64", "aarch64"):
154 build_rpms_listing.append((distro, release, arch))
155
156 build_debs_listing = []
157 for slug in sorted(slugs()):
158 if not slug.startswith(("debian-", "ubuntu-")):
159 continue
160 if slug.endswith("-arm64"):
161 continue
162 os_name, os_version = slug.split("-")

Callers

nothing calls this directly

Calls 9

slugsFunction · 0.85
NeedsTrackerClass · 0.85
setFunction · 0.50
appendMethod · 0.45
itemsMethod · 0.45
getMethod · 0.45
infoMethod · 0.45
get_templateMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected