Skip to content

Commit

Permalink
Don't rerun command for other version if its failing can break the wo…
Browse files Browse the repository at this point in the history
…rkflow
  • Loading branch information
thecatcore committed Aug 15, 2024
1 parent 5f4a978 commit 1ba2370
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,35 @@ def main():

commandList = []
if mainCommand == "publishToLocalAndTest":
commandList = [GRADLE_PREFIX + " publishToMavenLocal unifyMappings", "cd test-mod && " + GRADLE_PREFIX + " build genSources"]
commandList = [
[GRADLE_PREFIX + " publishToMavenLocal unifyMappings", True],
["cd test-mod && " + GRADLE_PREFIX + " build genSources", False]
]
elif mainCommand == "publish":
commandList = [GRADLE_PREFIX + " publish unifyMappings"]
commandList = [
[GRADLE_PREFIX + " publish unifyMappings", True]
]
elif mainCommand == "buildPublishToLocalAndTest":
commandList = [GRADLE_PREFIX + " build javadocJar checkMappings mapNamedJar unifyMappings", GRADLE_PREFIX + " publishToMavenLocal unifyMappings", "cd test-mod && " + GRADLE_PREFIX + " build genSources"]
commandList = [
[GRADLE_PREFIX + " build javadocJar checkMappings mapNamedJar unifyMappings", True],
[GRADLE_PREFIX + " publishToMavenLocal unifyMappings", True],
["cd test-mod && " + GRADLE_PREFIX + " build genSources", False]
]

failedVersions = []

for command in commandList:
testedVersion = [version for version in versions if version not in failedVersions]
print("Running command '" + command + "' for versions " + ", ".join(testedVersion))
print("Running command '" + command[0] + "' for versions " + ", ".join(testedVersion))

for version in testedVersion:
print("Running command for version " + version)
exitCode = yarn.run_command_with_mcversion(version, command)
exitCode = yarn.run_command_with_mcversion(version, command[0])

if exitCode != 0:
failedVersions.append(version)
if command[1]:
break

if len(failedVersions) < 1:
exit(0)
Expand Down

0 comments on commit 1ba2370

Please sign in to comment.