mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
ci: export cover report and add it to page wiki for badge
This commit is contained in:
@@ -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
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user