julia-actions / GitHubActions.jl

Utilities for working within GitHub Actions
MIT License
16 stars 10 forks source link

Error with nonstandard log level due to BenchmarkTools #28

Open gdalle opened 1 year ago

gdalle commented 1 year ago

I have a package where the CI uses BenchmarkTools.jl, and there is some logging with level -1 (see log level definition and log message generation). This causes an error because only standard log levels are taken into account for the GitHub action (see CI log).

ERROR: LoadError: MethodError: no method matching *(::String, ::Nothing)

Closest candidates are:
  *(::Any, ::Any, ::Any, ::Any...)
   @ Base operators.jl:578
  *(::Union{AbstractChar, AbstractString}, ::Union{AbstractChar, AbstractString}...)
   @ Base strings/basic.jl:260
  *(::Union{AbstractChar, AbstractString}, ::Missing)
   @ Base missing.jl:183
  ...

Stacktrace:
  [1] command(cmd::Nothing, props::NamedTuple{(:file, :line), Tuple{String, Int64}}, val::String)
    @ GitHubActions ~/.julia/packages/GitHubActions/DMn4Q/src/GitHubActions.jl:66
  [2] handle_message(::GitHubActions.GitHubActionsLogger, level::Base.CoreLogging.LogLevel, msg::String, _module::Module, group::Symbol, id::Base.UUID, file::String, line::Int64; location::Nothing, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:progress,), Tuple{Float64}}})
    @ GitHubActions ~/.julia/packages/GitHubActions/DMn4Q/src/GitHubActions.jl:250

I believe the culprit is this block of code, which needs an else otherwise cmd might be nothing: https://github.com/julia-actions/GitHubActions.jl/blob/bf65faa8a89658200e2496b9895f3d4e8ad3c719/src/GitHubActions.jl#L242-L250

gdalle commented 1 year ago

Edit: this issue appears to be the same as #16. It will be solved by #25