Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run black on PR and fix formatting issues in autogenerate_pipeline.py #162

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .buildkite/autogenerate_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@

BUILDKITE_PATH = pathlib.Path(__file__).parent.resolve()


class BuildkiteStep:
"""
This builds a Buildkite step according to a json configuration and the
Expand Down Expand Up @@ -246,7 +247,9 @@ def build(self, input):
# Wrap command with '' to avoid escaping early by `ENTRYPOINT`
command = json.dumps(command)
# Overwrite image tag for riscv64 platform CI
self.step_config["plugins"][0][f"docker#{DOCKER_PLUGIN_VERSION}"]["image"] = f"rustvmm/dev:{CONTAINER_VERSION_RISCV}"
self.step_config["plugins"][0][f"docker#{DOCKER_PLUGIN_VERSION}"][
"image"
] = f"rustvmm/dev:{CONTAINER_VERSION_RISCV}"
roypat marked this conversation as resolved.
Show resolved Hide resolved
# Since we are using qemu-system inside a x86_64 container, we
# should set `platform` field to x86_64 and unset the hypervisor to
# be passed
Expand Down Expand Up @@ -346,13 +349,14 @@ def determine_allowlist(config_file):
"""Determine the what platforms should be enabled for this crate"""

try:
with open(config_file, 'r') as file:
with open(config_file, "r") as file:
platforms = [line.strip() for line in file.readlines()]
return platforms
except Exception as e:
# Fall back to default platform if anything goes wrong
return ["x86_64", "aarch64"]


def generate_pipeline(config_file, platform_allowlist):
"""Generate the pipeline yaml file from a json configuration file."""

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
on:
push:
pull_request:

jobs:
black:
Expand All @@ -11,4 +12,4 @@ jobs:
run: pip install black

- name: Run black
run: black . --check
run: black . --check
Loading