mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Fix CI nox artifacts download
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
6bb31e2534
commit
4b2e9cae6a
3 changed files with 38 additions and 16 deletions
|
@ -48,7 +48,7 @@ ts = command_group(name="ts", help="Test Suite Related Commands", description=__
|
|||
},
|
||||
"platform": {
|
||||
"help": "The onedir platform artifact to download",
|
||||
"choices": ("linux", "darwin", "windows"),
|
||||
"choices": ("linux", "macos", "windows"),
|
||||
"required": True,
|
||||
},
|
||||
"arch": {
|
||||
|
@ -146,7 +146,12 @@ def setup_testsuite(
|
|||
if exitcode and exitcode != ExitCode.SOFT_FAIL:
|
||||
ctx.exit(exitcode)
|
||||
exitcode = tools.utils.gh.download_nox_artifact(
|
||||
ctx, run_id=run_id, slug=slug, nox_env="ci-test-onedir", repository=repository
|
||||
ctx,
|
||||
run_id=run_id,
|
||||
platform=platform,
|
||||
arch=arch,
|
||||
nox_env="ci-test-onedir",
|
||||
repository=repository,
|
||||
)
|
||||
if exitcode and exitcode != ExitCode.SOFT_FAIL:
|
||||
ctx.exit(exitcode)
|
||||
|
|
|
@ -77,10 +77,15 @@ def download_onedir_artifact(
|
|||
"help": "The workflow run ID from where to download artifacts from",
|
||||
"required": True,
|
||||
},
|
||||
"slug": {
|
||||
"help": "The OS slug",
|
||||
"platform": {
|
||||
"help": "The onedir platform artifact to download",
|
||||
"choices": ("linux", "macos", "windows"),
|
||||
"required": True,
|
||||
},
|
||||
"arch": {
|
||||
"help": "The onedir artifact architecture",
|
||||
"choices": ("x86_64", "aarch64", "amd64", "x86"),
|
||||
"required": True,
|
||||
"choices": OS_SLUGS,
|
||||
},
|
||||
"nox_env": {
|
||||
"help": "The nox environment name.",
|
||||
|
@ -93,7 +98,8 @@ def download_onedir_artifact(
|
|||
def download_nox_artifact(
|
||||
ctx: Context,
|
||||
run_id: int = None,
|
||||
slug: str = None,
|
||||
platform: str = None,
|
||||
arch: str = None,
|
||||
nox_env: str = "ci-test-onedir",
|
||||
repository: str = "saltstack/salt",
|
||||
):
|
||||
|
@ -102,14 +108,16 @@ def download_nox_artifact(
|
|||
"""
|
||||
if TYPE_CHECKING:
|
||||
assert run_id is not None
|
||||
assert slug is not None
|
||||
|
||||
if slug.endswith("arm64"):
|
||||
slug = slug.replace("-arm64", "")
|
||||
nox_env += "-aarch64"
|
||||
assert arch is not None
|
||||
assert platform is not None
|
||||
|
||||
exitcode = tools.utils.gh.download_nox_artifact(
|
||||
ctx=ctx, run_id=run_id, slug=slug, nox_env=nox_env, repository=repository
|
||||
ctx=ctx,
|
||||
run_id=run_id,
|
||||
platform=platform,
|
||||
arch=arch,
|
||||
nox_env=nox_env,
|
||||
repository=repository,
|
||||
)
|
||||
ctx.exit(exitcode)
|
||||
|
||||
|
|
|
@ -105,8 +105,9 @@ def download_onedir_artifact(
|
|||
|
||||
def download_nox_artifact(
|
||||
ctx: Context,
|
||||
platform: str,
|
||||
arch: str,
|
||||
run_id: int = None,
|
||||
slug: str = None,
|
||||
nox_env: str = "ci-test-onedir",
|
||||
repository: str = "saltstack/salt",
|
||||
) -> ExitCode:
|
||||
|
@ -115,7 +116,8 @@ def download_nox_artifact(
|
|||
"""
|
||||
if TYPE_CHECKING:
|
||||
assert run_id is not None
|
||||
assert slug is not None
|
||||
assert arch is not None
|
||||
assert platform is not None
|
||||
|
||||
artifacts_path = tools.utils.REPO_ROOT / ".nox" / nox_env
|
||||
if artifacts_path.exists():
|
||||
|
@ -123,7 +125,7 @@ def download_nox_artifact(
|
|||
f"The '.nox/{nox_env}' directory already exists ... Stopped processing."
|
||||
)
|
||||
return ExitCode.SOFT_FAIL
|
||||
artifact_name = f"nox-{slug}-{nox_env}"
|
||||
artifact_name = f"nox-{platform}-{arch}-{nox_env}"
|
||||
ctx.info(
|
||||
f"Searching for artifact {artifact_name} from run_id {run_id} in repository {repository} ..."
|
||||
)
|
||||
|
@ -139,7 +141,14 @@ def download_nox_artifact(
|
|||
ctx.error("Could not find the 'nox' binary in $PATH")
|
||||
return ExitCode.FAIL
|
||||
ret = ctx.run(
|
||||
nox, "--force-color", "-e", "decompress-dependencies", "--", slug, check=False
|
||||
nox,
|
||||
"--force-color",
|
||||
"-e",
|
||||
"decompress-dependencies",
|
||||
"--",
|
||||
platform,
|
||||
arch,
|
||||
check=False,
|
||||
)
|
||||
if ret.returncode:
|
||||
ctx.error("Failed to decompress the nox dependencies")
|
||||
|
|
Loading…
Add table
Reference in a new issue