Skip to content

Commit

Permalink
Support specifying allow_reresolve (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
omus authored Apr 16, 2024
1 parent 3a055a9 commit 7e64b54
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ inputs:
compiled_modules:
description: 'Whether to run tests with `compiled-modules`. For possible values, refer to https://docs.julialang.org/en/v1/manual/command-line-interface/#command-line-interface'
default: 'yes'
allow_reresolve:
description: 'Whether to allow re-resolving of package versions in the test environment. Only effective on Julia 1.9+. Options: true | false. Default value: true'
default: 'true'

runs:
using: 'composite'
Expand Down Expand Up @@ -70,3 +73,4 @@ runs:
FORCE_LATEST_COMPATIBLE_VERSION: ${{ inputs.force_latest_compatible_version }}
CHECK_BOUNDS: ${{ inputs.check_bounds }}
COMPILED_MODULES: ${{ inputs.compiled_modules }}
ALLOW_RERESOLVE: ${{ inputs.allow_reresolve }}
5 changes: 5 additions & 0 deletions kwargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include(joinpath(@__DIR__, "autodetect-dependabot.jl"))

function kwargs(; coverage,
force_latest_compatible_version,
allow_reresolve,
julia_args::AbstractVector{<:AbstractString}=String[])
if coverage isa AbstractString
coverage = parse(Bool, coverage)
Expand Down Expand Up @@ -51,6 +52,10 @@ function kwargs(; coverage,
kwargs_dict[:force_latest_compatible_version] = force_latest_compatible_version::Bool
end

if VERSION >= v"1.9"
kwargs_dict[:allow_reresolve] = parse(Bool, allow_reresolve)
end

return kwargs_dict
end

Expand Down
5 changes: 3 additions & 2 deletions test_harness.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Pkg
include("kwargs.jl")
kwargs = Kwargs.kwargs(; coverage=ENV["COVERAGE"],
force_latest_compatible_version=ENV["FORCE_LATEST_COMPATIBLE_VERSION"],
allow_reresolve=ENV["ALLOW_RERESOLVE"],
julia_args=[string("--check-bounds=", ENV["CHECK_BOUNDS"]),
string("--compiled-modules=", ENV["COMPILED_MODULES"])])

Expand All @@ -11,7 +12,7 @@ if parse(Bool, ENV["ANNOTATE"]) && v"1.8pre" < VERSION < v"1.9.0-beta3"
global_logger(GitHubActionsLogger())
include("test_logger.jl")
pop!(LOAD_PATH)
TestLogger.test(; kwargs...)
TestLogger.test(; kwargs...)
else
Pkg.test(; kwargs...)
Pkg.test(; kwargs...)
end

0 comments on commit 7e64b54

Please sign in to comment.