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
+12
View File
@@ -21,3 +21,15 @@ jobs:
run: cd ci && go get dagger.io/dagger@latest && cd ..
- name: Run Dagger Test Workflow
run: go run ci/test_on_push.go
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
with:
coverage-file: cover.out
report: true
chart: true
amend: true
if: |
matrix.os == 'ubuntu-latest' &&
github.event_name == 'push'
continue-on-error: true
+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)
}
}