From 3e16f720ec9c0bebcc4adae8de2a0e16c1c5baed Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 20 Aug 2026 12:01:16 -0400 Subject: [PATCH] Support monorepo globs in downstream tests Co-Authored-By: Chris Rackauckas --- .github/workflows/downstream.yml | 19 ++++++++++++++++--- test/runtests.jl | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 47a538c..5d45db0 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -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 @@ -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") diff --git a/test/runtests.jl b/test/runtests.jl index 050317d..1a5bc3e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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)