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

Make CI more agnostic of the owning GitHub organization #127312

Merged
merged 1 commit into from
Jul 5, 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
3 changes: 1 addition & 2 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
docker --version

REGISTRY=ghcr.io
# PR CI runs on rust-lang, but we want to use the cache from rust-lang-ci
REGISTRY_USERNAME=rust-lang-ci
REGISTRY_USERNAME=${GITHUB_REPOSITORY_OWNER}
Copy link
Contributor

@nikic nikic Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that the docker cache is no longer used in local builds, because GITHUB_REPOSITORY_OWNER Is not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, I forgot to fix this. I will send a PR later today, or tomorrow at the latest.

# Tag used to push the final Docker image, so that it can be pulled by e.g. rustup
IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci:${cksum}
# Tag used to cache the Docker build
Expand Down
14 changes: 5 additions & 9 deletions src/ci/github-actions/calculate-job-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,17 @@ def find_run_type(ctx: GitHubCtx) -> Optional[WorkflowRunType]:
if ctx.event_name == "pull_request":
return PRRunType()
elif ctx.event_name == "push":
old_bors_try_build = (
ctx.ref in ("refs/heads/try", "refs/heads/try-perf") and
ctx.repository == "rust-lang-ci/rust"
try_build = ctx.ref in (
"refs/heads/try",
"refs/heads/try-perf",
"refs/heads/automation/bors/try"
)
new_bors_try_build = (
ctx.ref == "refs/heads/automation/bors/try" and
ctx.repository == "rust-lang/rust"
)
try_build = old_bors_try_build or new_bors_try_build

if try_build:
jobs = get_custom_jobs(ctx)
return TryRunType(custom_jobs=jobs)

if ctx.ref == "refs/heads/auto" and ctx.repository == "rust-lang-ci/rust":
if ctx.ref == "refs/heads/auto":
return AutoRunType()

return None
Expand Down
Loading