Skip to content

Commit 56a7663

Browse files
authored
ci: fix coverage reporting for integration tests (#225)
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent f309793 commit 56a7663

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/integration-test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,22 @@ jobs:
6161
MONGODB_URI: mongodb://localhost:27017
6262
MARIADB_DSN: "strfmt_test:strfmt_test@tcp(localhost:3306)/strfmt_integration_test?parseTime=true&loc=UTC"
6363
POSTGRESQL_DSN: "postgres://strfmt_test:strfmt_test@localhost:5432/strfmt_integration_test?sslmode=disable"
64-
run: go test -tags testintegration -v -count=1 ./...
64+
run: >
65+
go test -tags testintegration -v -count=1
66+
-coverprofile='integration.coverage.ubuntu-latest-stable.out'
67+
-covermode=atomic
68+
-coverpkg='github.com/go-openapi/strfmt/...,github.com/go-openapi/strfmt/enable/mongodb/...'
69+
./...
70+
71+
- name: Upload coverage artifacts
72+
uses: actions/upload-artifact@v4
73+
with:
74+
path: 'internal/testintegration/integration.coverage.ubuntu-latest-stable.out'
75+
name: 'integration.coverage.ubuntu-latest-stable'
76+
retention-days: 1
77+
78+
collect-coverage:
79+
needs: [integration-test]
80+
if: ${{ !cancelled() && needs.integration-test.result == 'success' }}
81+
uses: go-openapi/ci-workflows/.github/workflows/collect-coverage.yml@34a5baa33361844b1d2c70cd4548e3cea83529d9 # v0.2.13
82+
secrets: inherit

0 commit comments

Comments
 (0)