Skip to content
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
19 changes: 16 additions & 3 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
required: false
type: string
upstream-subdirs:
description: "Comma-separated package paths in the calling repository to develop"
description: "Comma-separated package paths or directory globs ending in /* in the calling repository to develop"
default: "."
required: false
type: string
Expand Down Expand Up @@ -113,9 +113,22 @@ jobs:
error("No downstream Project.toml at $downstream_project")
Pkg.activate(downstream_project)
@info "Selected downstream project" downstream_project
upstream_projects = filter(!isempty, strip.(split(ENV["UPSTREAM_SUBDIRS"], ',')))
upstream_specs = filter(!isempty, strip.(split(ENV["UPSTREAM_SUBDIRS"], ',')))
upstream_projects = String[]
for spec in upstream_specs
if endswith(spec, "/*")
matches = filter(
project -> isfile(joinpath(project, "Project.toml")),
readdir(dirname(spec); join=true),
)
isempty(matches) && error("No upstream package projects matched $spec")
append!(upstream_projects, matches)
else
push!(upstream_projects, spec)
end
end
isempty(upstream_projects) && error("No upstream package projects selected")
upstream_projects = normpath.(upstream_projects)
upstream_projects = unique(normpath.(upstream_projects))
for project in upstream_projects
isfile(joinpath(project, "Project.toml")) ||
error("No upstream Project.toml at $project")
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ end
@test occursin("split(ENV[\"UPSTREAM_SUBDIRS\"], ',')", txt)
@test occursin("isfile(joinpath(project, \"Project.toml\"))", txt)
@test occursin("Pkg.develop(map(project -> PackageSpec(path=project), upstream_projects))", txt)
@test occursin("endswith(spec, \"/*\")", txt)
@test occursin("readdir(dirname(spec); join=true)", txt)

activate_at = findfirst("Pkg.activate(downstream_project)", txt)
develop_at = findfirst("Pkg.develop(map(project -> PackageSpec(path=project), upstream_projects))", txt)
Expand Down
Loading