Skip to content

Commit

Permalink
[plugin] add coverage function
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Apr 10, 2024
1 parent 830a5bc commit 83a9164
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
pipeline: deno
args: |
fmt
test --coverage=coverage --lock-write
test
coverage
- name: Run Dagger Pipelines
run: |
dagger -m github.com/fluent-ci-templates/deno-pipeline@main functions
Expand Down
2 changes: 1 addition & 1 deletion plugin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "deno"
version = "0.10.0"
version = "0.10.1"

[lib]
crate-type = ["cdylib"]
Expand Down
20 changes: 19 additions & 1 deletion plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,25 @@ pub fn test(args: String) -> FnResult<String> {
.pipeline("test")?
.pkgx()?
.with_packages(vec!["deno"])?
.with_exec(vec!["deno", "test", "-A", &args])?
.with_exec(vec![
"deno",
"test",
"-A",
"--coverage=coverage",
"--lock-write",
&args,
])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn coverage() -> FnResult<String> {
let stdout = dag()
.pipeline("coverage")?
.pkgx()?
.with_packages(vec!["deno"])?
.with_exec(vec!["deno coverage ./coverage --lcov > coverage.lcov"])?
.stdout()?;
Ok(stdout)
}
Expand Down

0 comments on commit 83a9164

Please sign in to comment.