Skip to content

Commit

Permalink
fix downstream tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 committed Jul 28, 2024
1 parent db677b6 commit 49618a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ jobs:
PackageSpec(path="."),
PackageSpec(path="./lib/TestsForCodecPackages"),
])
Pkg.instantiate()
Pkg.update()
Pkg.status(;mode=Pkg.PKGMODE_PROJECT)
Pkg.status(;mode=Pkg.PKGMODE_MANIFEST)
shell: julia --project=test --color=yes --check-bounds=yes {0}
- name: Run tests
env:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,31 @@ jobs:
with:
version: ${{ matrix.julia-version }}
arch: x64
- uses: julia-actions/julia-buildpkg@latest
- name: Clone Downstream
uses: actions/checkout@v4
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
- name: Load this and run the downstream tests
shell: julia --color=yes --project=downstream {0}
shell: julia --color=yes {0}
run: |
using Pkg
using TOML
Pkg.Registry.update()
Pkg.activate(;temp=true)
try
# force it to use this PR's version of the package and test package
Pkg.develop([
PackageSpec(path="downstream"),
PackageSpec(path="."),
PackageSpec(path="./lib/TestsForCodecPackages")
PackageSpec(path="./lib/TestsForCodecPackages"),
])
# resolver may fail with main deps
Pkg.update()
Pkg.test() # resolver may fail with test time deps
p1 = joinpath("downstream", "JuliaProject.toml")
p2 = joinpath("downstream", "Project.toml")
proj_toml = isfile(p1) ? p1 : p2
Pkg.test(TOML.parsefile(proj_toml)["name"]) # resolver may fail with test time deps
catch err
err isa Pkg.Resolve.ResolverError || rethrow()
# If we can't resolve that means this is incompatible by SemVer and this is fine.
Expand Down

0 comments on commit 49618a7

Please sign in to comment.