mirror of
https://github.com/julia-actions/julia-processcoverage.git
synced 2026-02-15 20:46:57 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03114f09f1 | ||
|
|
605cc6b85a | ||
|
|
6e018a9646 | ||
|
|
a89a6dbd45 |
20
README.md
20
README.md
@@ -4,33 +4,33 @@
|
||||
|
||||
## Usage
|
||||
|
||||
See [PkgTemplates.jl](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/AllPlugins/.github/workflows/ci.yml) for a complete example.
|
||||
See [PkgTemplates.jl](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/AllPlugins/.github/workflows/CI.yml) for a complete example.
|
||||
|
||||
```yaml
|
||||
|
||||
- uses: julia-actions/julia-processcoverage@v1
|
||||
- uses: codecov/codecov-action@v1
|
||||
- uses: codecov/codecov-action@v2
|
||||
with:
|
||||
file: lcov.info
|
||||
files: lcov.info
|
||||
```
|
||||
|
||||
One can also specify the directory or directories to use via the `directories` input (which defaults to `src`). E.g.
|
||||
One can also specify the directory or directories (comma separated) to use via the `directories` input (which defaults to `src,ext`). E.g.
|
||||
```yaml
|
||||
|
||||
- uses: julia-actions/julia-processcoverage@v1
|
||||
with:
|
||||
directories: src,examples
|
||||
- uses: codecov/codecov-action@v1
|
||||
directories: src,ext,examples
|
||||
- uses: codecov/codecov-action@v2
|
||||
with:
|
||||
file: lcov.info
|
||||
files: lcov.info
|
||||
```
|
||||
instructs the action to look for coverage information in both `src` and an `examples` folder. Likewise, use
|
||||
instructs the action to look for coverage information in `src`, `ext`, 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
|
||||
- uses: codecov/codecov-action@v2
|
||||
with:
|
||||
file: lcov.info
|
||||
files: lcov.info
|
||||
```
|
||||
to get coverage information from a package in a subdirectory of the repo.
|
||||
|
||||
@@ -10,7 +10,7 @@ inputs:
|
||||
directories:
|
||||
description: 'Comma-separated list of directories to look for coverage information (e.g. `src,examples`)'
|
||||
required: false
|
||||
default: 'src'
|
||||
default: 'src,ext'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
|
||||
10
main.jl
10
main.jl
@@ -6,11 +6,15 @@ Pkg.add(PackageSpec(name="CoverageTools"))
|
||||
|
||||
using CoverageTools
|
||||
|
||||
directories = get(ENV, "INPUT_DIRECTORIES", "src")
|
||||
directories = get(ENV, "INPUT_DIRECTORIES", "src,ext")
|
||||
dirs = filter!(!isempty, split(directories, ","))
|
||||
for dir in dirs
|
||||
isdir(dir) || error("directory \"$dir\" not found!")
|
||||
if dir == "ext"
|
||||
continue # Silently skip this directory
|
||||
elseif !isdir(dir)
|
||||
error("directory \"$dir\" not found!")
|
||||
end
|
||||
end
|
||||
|
||||
filter!(isdir, dirs)
|
||||
pfs = mapreduce(process_folder, vcat, dirs)
|
||||
LCOV.writefile("lcov.info", pfs)
|
||||
|
||||
Reference in New Issue
Block a user