mirror of
https://github.com/julia-actions/julia-processcoverage.git
synced 2026-02-12 11:06:58 +08:00
Add directories input (#8)
Co-authored-by: Sascha Mann <git@mail.saschamann.eu> Co-authored-by: Michael Schlottke-Lakemper <michael@sloede.com>
This commit is contained in:
21
README.md
21
README.md
@@ -13,3 +13,24 @@ See [PkgTemplates.jl](https://github.com/invenia/PkgTemplates.jl/blob/master/tes
|
|||||||
with:
|
with:
|
||||||
file: lcov.info
|
file: lcov.info
|
||||||
```
|
```
|
||||||
|
|
||||||
|
One can also specify the directory or directories to use via the `directories` input (which defaults to `src`). E.g.
|
||||||
|
```yaml
|
||||||
|
|
||||||
|
- uses: julia-actions/julia-processcoverage@v1
|
||||||
|
with:
|
||||||
|
directories: src,examples
|
||||||
|
- uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
file: lcov.info
|
||||||
|
```
|
||||||
|
instructs the action to look for coverage information in both `src` and an `examples` folder. Likewise, use
|
||||||
|
```yaml
|
||||||
|
- uses: julia-actions/julia-processcoverage@v1
|
||||||
|
with:
|
||||||
|
directories: path/to/subdir/package/src
|
||||||
|
- uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
file: lcov.info
|
||||||
|
```
|
||||||
|
to get coverage information from a package in a subdirectory of the repo.
|
||||||
|
|||||||
@@ -6,8 +6,16 @@ branding:
|
|||||||
icon: 'settings'
|
icon: 'settings'
|
||||||
color: 'gray-dark'
|
color: 'gray-dark'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
directories:
|
||||||
|
description: 'Comma-separated list of directories to look for coverage information (e.g. `src,examples`)'
|
||||||
|
required: false
|
||||||
|
default: 'src'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- run: julia --color=yes "$GITHUB_ACTION_PATH"/main.jl
|
- run: julia --color=yes "$GITHUB_ACTION_PATH"/main.jl
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
INPUT_DIRECTORIES: ${{ inputs.directories }}
|
||||||
|
|||||||
9
main.jl
9
main.jl
@@ -6,6 +6,11 @@ Pkg.add(PackageSpec(name="CoverageTools"))
|
|||||||
|
|
||||||
using CoverageTools
|
using CoverageTools
|
||||||
|
|
||||||
pf = process_folder()
|
directories = get(ENV, "INPUT_DIRECTORIES", "src")
|
||||||
|
dirs = filter!(!isempty, split(directories, ","))
|
||||||
|
for dir in dirs
|
||||||
|
isdir(dir) || error("directory \"$dir\" not found!")
|
||||||
|
end
|
||||||
|
|
||||||
LCOV.writefile("lcov.info", pf)
|
pfs = mapreduce(process_folder, vcat, dirs)
|
||||||
|
LCOV.writefile("lcov.info", pfs)
|
||||||
|
|||||||
Reference in New Issue
Block a user