Skip to content

Commit

Permalink
restore downstream tests
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Oct 13, 2024
1 parent c1cfa30 commit 72b8612
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ jobs:
- name: Test downstream packages
if: startsWith(matrix.os, 'ubuntu')
run: |
xvfb-run julia --color=yes ci/downstream.jl GraphRecipes || true
xvfb-run julia --color=yes ci/downstream.jl StatsPlots || true
xvfb-run julia --color=yes ci/downstream.jl GraphRecipes
xvfb-run julia --color=yes ci/downstream.jl StatsPlots
- uses: julia-actions/julia-processcoverage@latest
if: startsWith(matrix.os, 'ubuntu')
Expand Down
23 changes: 15 additions & 8 deletions ci/downstream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ using Pkg
const LibGit2 = Pkg.GitTools.LibGit2
const TOML = Pkg.TOML

failsafe_clone_checkout(path, url) = begin
failsafe_clone_checkout(path, url; branch="master", stable=true) = begin
local repo
for i in 1:6
try
repo = Pkg.GitTools.ensure_clone(stdout, path, url)
repo = Pkg.GitTools.ensure_clone(stdout, path, url; branch)
break
catch err
@warn err
Expand All @@ -27,11 +27,14 @@ failsafe_clone_checkout(path, url) = begin
end
@assert isfile(versions)

version_dict = TOML.parse(read(versions, String))
stable = VersionNumber.(keys(version_dict)) |> maximum
tag = LibGit2.GitObject(repo, "v$stable")
hash = string(LibGit2.target(tag))
LibGit2.checkout!(repo, hash)
if stable
version_dict = TOML.parse(read(versions, String))
stable = VersionNumber.(keys(version_dict)) |> maximum
tag = LibGit2.GitObject(repo, "v$stable")
hash = string(LibGit2.target(tag))
LibGit2.checkout!(repo, hash)
else
end
nothing
end

Expand Down Expand Up @@ -65,7 +68,11 @@ test_stable(pkg::AbstractString) = begin
end

pkg_dir = joinpath(tmpd, "$pkg.jl")
failsafe_clone_checkout(pkg_dir, "https://github.com/JuliaPlots/$pkg.jl")
if true # v2, remove when stable
failsafe_clone_checkout(pkg_dir, "https://github.com/JuliaPlots/$pkg.jl"; branch="v2", stable=false)
else
failsafe_clone_checkout(pkg_dir, "https://github.com/JuliaPlots/$pkg.jl")
end
fake_supported_versions!(pkg_dir)

Pkg.develop(; path = pkg_dir)
Expand Down
8 changes: 4 additions & 4 deletions docs/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ export JULIA_CONDAPKG_BACKEND=MicroMamba

julia='xvfb-run -a julia --color=yes --project=docs'

# $julia -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/JuliaPlots/Plots.jl", rev=split(ENV["GITHUB_REF"], "/", limit=3)[3], subdir="RecipesBase"));' #FIXME: not needed when registered
# $julia -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/JuliaPlots/Plots.jl", rev=split(ENV["GITHUB_REF"], "/", limit=3)[3], subdir="RecipesPipeline"));' #FIXME: not needed when registered
# $julia -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/JuliaPlots/Plots.jl", rev=split(ENV["GITHUB_REF"], "/", limit=3)[3], subdir="PlotsBase"));' #FIXME: not needed when registered
$julia -e 'using Pkg; Pkg.develop([(;path="."), (;path="./RecipesBase"), (;path="./RecipesPipeline"), (;path="./PlotsBase")]);' #FIXME: not needed when registered
$julia -e 'using Pkg; Pkg.develop([(; path="."), (; path="./RecipesBase"), (; path="./RecipesPipeline"), (; path="./PlotsBase")]);' # FIXME: not needed when registered
$julia -e '
using Pkg; Pkg.add("CondaPkg")
using CondaPkg; CondaPkg.resolve()
Expand All @@ -79,6 +76,9 @@ $julia -e '
CondaPkg.status()
'

$julia -e 'using Pkg; Pkg.add(PackageSpec(name="StatsPlots", rev="v2"))' # FIXME: remove when StatsPlots v2 is out
$julia -e 'using Pkg; Pkg.add(PackageSpec(name="GraphRecipes", rev="v2"))' # FIXME: remove when StatsPlots v2 is out

echo "== build documentation for $GITHUB_REPOSITORY@$GITHUB_REF, triggered by $GITHUB_ACTOR on $GITHUB_EVENT_NAME =="
if [ "$GITHUB_REPOSITORY" == 'JuliaPlots/PlotDocs.jl' ]; then
$julia -e 'using Pkg; Pkg.add(PackageSpec(name="Plots", rev="master"))'
Expand Down

0 comments on commit 72b8612

Please sign in to comment.