Skip to content

Commit

Permalink
Support for specifying dirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Nov 9, 2020
1 parent c235295 commit 9eb8f85
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 14 additions & 3 deletions hooks/post-command
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ configuration:
properties:
codecov:
type: boolean
dirs:
type: array
additionalProperties: false

0 comments on commit 9eb8f85

Please sign in to comment.