mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-22 10:22:29 +00:00
ci: reduce the number of runners (#7750)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
1 parent
1d0247b7dd
commit
5a5a927821
4 files changed
+94
-75
No files matched your search
@@ -54,8 +54,6 @@ ADDON_RUNNERS = {
|
||||
"windows-x86_64": "windows-latest",
|
||||
}
|
||||
ADDON_PLATFORMS = list(ADDON_RUNNERS)
|
||||
# build.yml builds libsimplex of pull requests on this platform only
|
||||
CORE_TEST_PLATFORM = "linux-x86_64"
|
||||
ADDON_ASSETS = [f"simplex-chat-nodejs-{platform}.node" for platform in ADDON_PLATFORMS]
|
||||
SHA256_HEX = re.compile(r"^[0-9a-f]{64}$")
|
||||
RELEASES_FILE = "releases.toml"
|
||||
@@ -275,12 +273,10 @@ class BuildPlan:
|
||||
|
||||
|
||||
def build_plan(
|
||||
event: str, release_missing: bool, libs_artifact: bool, libs_release: str, core_changed: bool, addon_changed: bool
|
||||
event: str, release_missing: bool, libs_release: str, core_changed: bool, addon_changed: bool
|
||||
) -> BuildPlan:
|
||||
"""Each package test runs once, against the libsimplex of the change: a pull request that changes the core
|
||||
is tested by build.yml with its own libsimplex (libs_artifact), a new library release with that release."""
|
||||
if libs_artifact:
|
||||
return BuildPlan([CORE_TEST_PLATFORM], test=True)
|
||||
is tested by build.yml with its own libsimplex, a new library release with that release."""
|
||||
if libs_release:
|
||||
return BuildPlan(ADDON_PLATFORMS, test=True)
|
||||
if event == "pull_request":
|
||||
@@ -382,11 +378,10 @@ def changes(base: str) -> None:
|
||||
|
||||
|
||||
def print_build_plan(args: argparse.Namespace) -> None:
|
||||
pull_request = args.event == "pull_request" and not args.libs_artifact
|
||||
pull_request = args.event == "pull_request"
|
||||
result = build_plan(
|
||||
args.event,
|
||||
release_missing=args.release_missing,
|
||||
libs_artifact=args.libs_artifact,
|
||||
libs_release=args.libs_release,
|
||||
core_changed=pull_request and changed_since(args.base, CORE_SOURCES),
|
||||
addon_changed=pull_request and changed_since(args.base, ADDON_SOURCES),
|
||||
@@ -637,7 +632,6 @@ def main(argv: list[str]) -> None:
|
||||
build_parser.add_argument("--event", required=True, help="github.event_name")
|
||||
build_parser.add_argument("--base", default="", help="the base commit of a pull request")
|
||||
build_parser.add_argument("--release-missing", type=github_bool, default=False)
|
||||
build_parser.add_argument("--libs-artifact", type=github_bool, default=False)
|
||||
build_parser.add_argument("--libs-release", default="")
|
||||
prepare_parser = commands.add_parser("prepare")
|
||||
for package in ["nodejs", "types", "python"]:
|
||||
|
||||
@@ -205,8 +205,8 @@ class PlanTest(unittest.TestCase):
|
||||
|
||||
|
||||
class BuildPlanTest(unittest.TestCase):
|
||||
def plan(self, event="push", release_missing=False, libs_artifact=False, libs_release="", core=False, addon=False):
|
||||
return build_plan(event, release_missing, libs_artifact, libs_release, core, addon)
|
||||
def plan(self, event="push", release_missing=False, libs_release="", core=False, addon=False):
|
||||
return build_plan(event, release_missing, libs_release, core, addon)
|
||||
|
||||
def test_push_builds_a_missing_addon_release_and_tests_it(self):
|
||||
self.assertEqual(self.plan(release_missing=True), BuildPlan(ADDON_PLATFORMS, test=True))
|
||||
@@ -220,11 +220,6 @@ class BuildPlanTest(unittest.TestCase):
|
||||
self.assertEqual(self.plan("pull_request", core=True), BuildPlan([], test=False))
|
||||
self.assertEqual(self.plan("pull_request", core=True, addon=True), BuildPlan(ADDON_PLATFORMS, test=False))
|
||||
|
||||
def test_libsimplex_of_the_pull_request_is_tested_on_its_platform(self):
|
||||
self.assertEqual(
|
||||
self.plan("pull_request", libs_artifact=True, core=True), BuildPlan(["linux-x86_64"], test=True)
|
||||
)
|
||||
|
||||
def test_new_library_release_is_tested_on_every_platform(self):
|
||||
self.assertEqual(self.plan(libs_release="core-1.0.0.2"), BuildPlan(ADDON_PLATFORMS, test=True))
|
||||
|
||||
|
||||
Reference in new issue
Block a user