diff --git a/hooks/post-command b/hooks/post-command index 720c618..732f9ca 100755 --- a/hooks/post-command +++ b/hooks/post-command @@ -1,15 +1,26 @@ #!/bin/bash -set -euov pipefail +set -euo pipefail echo "--- :julia: Processing coverage" +# parse the 'dirs' property +dirs=() +while IFS='=' read -r name _ ; do + if [[ $name =~ ^(BUILDKITE_PLUGIN_JULIA_COVERAGE_DIRS_[0-9]+) ]] ; then + dirs+=( "${!name}" ) + fi +done < <(env | sort) +if [ ${#dirs[@]} -eq 0 ]; then + dirs+=( "src" ) +fi + julia -e 'using Pkg; Pkg.activate("julia-coverage", shared=true); Pkg.add(PackageSpec(name="CoverageTools")); using CoverageTools; - pf = process_folder(); - LCOV.writefile("lcov.info", pf)' + pf = vcat(map(process_folder, ARGS)...); + LCOV.writefile("lcov.info", pf)' "${dirs[@]}" codecov=${BUILDKITE_PLUGIN_JULIA_COVERAGE_CODECOV:-false} diff --git a/plugin.yml b/plugin.yml index c834039..c9d1bd8 100644 --- a/plugin.yml +++ b/plugin.yml @@ -6,4 +6,6 @@ configuration: properties: codecov: type: boolean + dirs: + type: array additionalProperties: false