mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
remove some debugging
This commit is contained in:
parent
a5960cab09
commit
00df4de895
5 changed files with 17 additions and 101 deletions
4
.github/workflows/build-deps-onedir.yml
vendored
4
.github/workflows/build-deps-onedir.yml
vendored
|
@ -38,7 +38,7 @@ env:
|
|||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Test Matrix
|
||||
name: Test Matrix (${{ inputs.kind }})
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
|
||||
|
@ -58,7 +58,7 @@ jobs:
|
|||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
cache-prefix: ${{ inputs.cache-seed }}
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
|
|
2
.github/workflows/build-packages.yml
vendored
2
.github/workflows/build-packages.yml
vendored
|
@ -51,7 +51,7 @@ env:
|
|||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Test Matrix
|
||||
name: Test Matrix ${{ inputs.kind }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
|
||||
|
|
4
.github/workflows/build-salt-onedir.yml
vendored
4
.github/workflows/build-salt-onedir.yml
vendored
|
@ -38,7 +38,7 @@ env:
|
|||
jobs:
|
||||
|
||||
generate-matrix:
|
||||
name: Test Matrix
|
||||
name: Test Matrix (${{ inputs.kind }})
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix-include: ${{ steps.generate-matrix.outputs.matrix }}
|
||||
|
@ -58,7 +58,7 @@ jobs:
|
|||
- name: Setup Python Tools Scripts
|
||||
uses: ./.github/actions/setup-python-tools-scripts
|
||||
with:
|
||||
cache-prefix: ${{ inputs.cache-prefix }}
|
||||
cache-prefix: ${{ inputs.cache-seed }}
|
||||
env:
|
||||
PIP_INDEX_URL: https://pypi.org/simple
|
||||
|
||||
|
|
12
.github/workflows/test-packages-action-linux.yml
vendored
12
.github/workflows/test-packages-action-linux.yml
vendored
|
@ -191,16 +191,18 @@ jobs:
|
|||
run: |
|
||||
tools --timestamps vm ssh ${{ inputs.distro-slug }} -- df -h || true
|
||||
|
||||
- name: check systemd
|
||||
run: systemctl
|
||||
# - name: check systemd
|
||||
# run: systemctl
|
||||
#
|
||||
#- name: Mock systemd
|
||||
# run: |
|
||||
# wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/refs/heads/master/files/docker/systemctl3.py
|
||||
# cp systemctl3.py /usr/bin/systemctl
|
||||
# chmod +x /usr/bin/systemctl
|
||||
- name: install pkg test
|
||||
run: |
|
||||
dpkg -i ./artifacts/pkg/salt-common_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb ./artifacts/pkg/salt-master_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb
|
||||
#
|
||||
#- name: install pkg test
|
||||
# run: |
|
||||
# dpkg -i ./artifacts/pkg/salt-common_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb ./artifacts/pkg/salt-master_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb
|
||||
|
||||
- name: Show System Info
|
||||
env:
|
||||
|
|
96
tools/ci.py
96
tools/ci.py
|
@ -152,96 +152,6 @@ def process_changed_files(ctx: Context, event_name: str, changed_files: pathlib.
|
|||
ctx.exit(0)
|
||||
|
||||
|
||||
@ci.command(
|
||||
name="runner-types",
|
||||
arguments={
|
||||
"event_name": {
|
||||
"help": "The name of the GitHub event being processed.",
|
||||
},
|
||||
},
|
||||
)
|
||||
def runner_types(ctx: Context, event_name: str):
|
||||
"""
|
||||
Set GH Actions 'runners' output to know what can run where.
|
||||
"""
|
||||
gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None
|
||||
if gh_event_path is None:
|
||||
ctx.warn("The 'GITHUB_EVENT_PATH' variable is not set.")
|
||||
ctx.exit(1)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
assert gh_event_path is not None
|
||||
|
||||
github_output = os.environ.get("GITHUB_OUTPUT")
|
||||
if github_output is None:
|
||||
ctx.warn("The 'GITHUB_OUTPUT' variable is not set.")
|
||||
ctx.exit(1)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
assert github_output is not None
|
||||
|
||||
try:
|
||||
gh_event = json.loads(open(gh_event_path, encoding="utf-8").read())
|
||||
except Exception as exc:
|
||||
ctx.error(f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc)
|
||||
ctx.exit(1)
|
||||
|
||||
ctx.info("GH Event Payload:")
|
||||
ctx.print(gh_event, soft_wrap=True)
|
||||
# Let's it print until the end
|
||||
time.sleep(1)
|
||||
|
||||
ctx.info("Selecting which type of runners(self hosted runners or not) to run")
|
||||
runners = {"github-hosted": False, "self-hosted": False, "linux-arm64": False}
|
||||
if "LINUX_ARM_RUNNER" in os.environ and os.environ["LINUX_ARM_RUNNER"] != "0":
|
||||
runners["linux-arm64"] = True
|
||||
if event_name == "pull_request":
|
||||
ctx.info("Running from a pull request event")
|
||||
pr_event_data = gh_event["pull_request"]
|
||||
if (
|
||||
pr_event_data["head"]["repo"]["full_name"]
|
||||
== pr_event_data["base"]["repo"]["full_name"]
|
||||
):
|
||||
# If this is a pull request coming from the same repository, don't run anything
|
||||
ctx.info("Pull request is coming from the same repository.")
|
||||
ctx.info("Not running any jobs since they will run against the branch")
|
||||
ctx.info("Writing 'runners' to the github outputs file:\n", runners)
|
||||
with open(github_output, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(f"runners={json.dumps(runners)}\n")
|
||||
ctx.exit(0)
|
||||
|
||||
# This is a PR from a forked repository
|
||||
ctx.info("Pull request is not comming from the same repository")
|
||||
runners["github-hosted"] = runners["self-hosted"] = True
|
||||
ctx.info("Writing 'runners' to the github outputs file:\n", runners)
|
||||
with open(github_output, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(f"runners={json.dumps(runners)}\n")
|
||||
ctx.exit(0)
|
||||
|
||||
# This is a push or a scheduled event
|
||||
ctx.info(f"Running from a {event_name!r} event")
|
||||
if (
|
||||
gh_event["repository"]["fork"] is True
|
||||
and os.environ.get("FORK_HAS_SELF_HOSTED_RUNNERS", "0") == "1"
|
||||
):
|
||||
# This is running on a forked repository, don't run tests
|
||||
ctx.info("The push event is on a forked repository")
|
||||
if os.environ.get("FORK_HAS_SELF_HOSTED_RUNNERS", "0") == "1":
|
||||
# This is running on a forked repository, don't run tests
|
||||
runners["github-hosted"] = runners["self-hosted"] = True
|
||||
ctx.info("Writing 'runners' to the github outputs file:\n", runners)
|
||||
with open(github_output, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(f"runners={json.dumps(runners)}\n")
|
||||
ctx.exit(0)
|
||||
# Not running on a fork, or the fork has self hosted runners, run everything
|
||||
ctx.info(f"The {event_name!r} event is from the main repository")
|
||||
runners["github-hosted"] = runners["self-hosted"] = True
|
||||
ctx.info("Writing 'runners' to the github outputs file:\n", runners)
|
||||
with open(github_output, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(f"runners={json.dumps(runners)}")
|
||||
ctx.exit(0)
|
||||
|
||||
|
||||
@ci.command(
|
||||
name="define-jobs",
|
||||
arguments={
|
||||
|
@ -659,7 +569,9 @@ def build_matrix(
|
|||
kind: str,
|
||||
):
|
||||
"""
|
||||
Generate the test matrix.
|
||||
Generate matrix for onedir workflows.
|
||||
|
||||
The build-onedir-deps and build-salt-onedir workflows call this method.
|
||||
"""
|
||||
github_output = os.environ.get("GITHUB_OUTPUT")
|
||||
if github_output is None:
|
||||
|
@ -863,6 +775,8 @@ def pkg_matrix(
|
|||
else:
|
||||
arch = "x86_64"
|
||||
|
||||
ctx.info(f"Parsed linux slug parts {name} {version} {arch}")
|
||||
|
||||
if name == "amazonlinux":
|
||||
name = "amazon"
|
||||
elif name == "rockylinux":
|
||||
|
|
Loading…
Add table
Reference in a new issue