ci: export cover report and add it to page wiki for badge

This commit is contained in:
Slug-Boi
2025-04-10 12:43:46 +02:00
parent 5cd8ee63b6
commit cf392035d3
2 changed files with 20 additions and 2 deletions
+7 -1
View File
@@ -35,10 +35,16 @@ func main() {
WithExec([]string{"go", "mod", "tidy"}).WithEnvVariable("CI", "true")
// run application tests
out, err := runner.WithWorkdir("/src_d/src").WithExec([]string{"go", "test", "./..."}).
out, err := runner.WithWorkdir("/src_d/src").WithExec([]string{"go", "test", "./cmd/utils", "./cmd/tui", "-coverprofile cover.out"}).
Stderr(ctx)
if err != nil {
panic(err)
}
fmt.Println(out)
// export the coverage report
_, err = client.Host().Directory(".").WithFile("cover.out", runner.File("/src_d/src/cover.out")).Export(ctx, ".")
if err != nil {
panic(err)
}
}