diff --git a/.github/workflows/test_push.yml b/.github/workflows/test_push.yml index da15206..8be4c54 100644 --- a/.github/workflows/test_push.yml +++ b/.github/workflows/test_push.yml @@ -20,4 +20,16 @@ jobs: - name: Get Dagger run: cd ci && go get dagger.io/dagger@latest && cd .. - name: Run Dagger Test Workflow - run: go run ci/test_on_push.go \ No newline at end of file + 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 \ No newline at end of file diff --git a/ci/test_on_push.go b/ci/test_on_push.go index 17edfd5..30b4f8d 100644 --- a/ci/test_on_push.go +++ b/ci/test_on_push.go @@ -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) + } } \ No newline at end of file