name: 'Run Julia package tests' description: 'Run the tests in a Julia package' author: 'David Anthoff' branding: icon: 'aperture' color: 'gray-dark' inputs: coverage: description: 'Value determining whether to test with coverage or not. Options: true | false. Default value: true.' default: 'true' depwarn: description: 'Value passed to the --depwarn flag. Options: yes | no | error. Default value: yes.' default: 'yes' force_latest_compatible_version: description: 'If true, then, for each [compat] entry in the active project, only allow the latest compatible version. If the value is auto and the pull request has been opened by Dependabot or CompatHelper, then force_latest_compatible_version will be set to true, otherwise it will be set to false. Options: true | false | auto. Default value: auto.' default: 'auto' inline: description: 'Value passed to the --inline flag. Options: yes | no. Default value: yes.' default: 'yes' prefix: description: 'Value inserted in front of the julia command, e.g. for running xvfb-run julia [...]' default: '' required: false project: description: 'Value passed to the --project flag. The default value is the repository root: "@."' default: '@.' runs: using: 'composite' steps: # Occasionally, there are rather large delays (> a few hours) # between the time a package is registered in General and # propagated to pkg.julialang.org. We can avoid this by manually # cloning ~/.julia/registries/General/ in Julia 1.5 and later. # See: # * https://github.com/JuliaLang/Pkg.jl/issues/2011 # * https://github.com/JuliaRegistries/General/issues/16777 # * https://github.com/JuliaPackaging/PkgServer.jl/issues/60 - run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.jl shell: bash env: # We set `JULIA_PKG_SERVER` only for this step to enforce # `Pkg.Registry.add` to use Git. This way, Pkg.jl can send # the request metadata to pkg.julialang.org when installing # packages via `Pkg.test`. JULIA_PKG_SERVER: "" - run: | # The Julia command that will be executed julia_cmd=( julia --check-bounds=yes --color=yes --depwarn=${{ inputs.depwarn }} --inline=${{ inputs.inline }} --project=${{ inputs.project }} -e 'import Pkg;include(joinpath(ENV["GITHUB_ACTION_PATH"], "kwargs.jl"));kwargs = Kwargs.kwargs(;coverage = :(${{ inputs.coverage }}),force_latest_compatible_version = :(${{ inputs.force_latest_compatible_version }}),);Pkg.test(; kwargs...)' ) # Add the prefix in front of the command if there is one prefix="${{ inputs.prefix }}" [[ -n $prefix ]] && julia_cmd=( "$prefix" "${julia_cmd[@]}" ) # Run the Julia command "${julia_cmd[@]}" shell: bash