File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,18 @@ jobs:
56
56
go-version-file : ' go.mod'
57
57
58
58
- name : Run tests
59
- run : go test ./...
59
+ run : go test -cover -coverprofile=coverage.out ./...
60
60
env :
61
61
POSTGRES_VERSION : ${{ matrix.pgVersion }}
62
62
PGROLL_TEST_SCHEMA : ${{ matrix.testSchema }}
63
63
64
+ - name : Archive code coverage results
65
+ uses : actions/upload-artifact@v4
66
+ if : matrix.pgVersion == 'latest' && matrix.testSchema == 'public'
67
+ with :
68
+ name : code-coverage
69
+ path : coverage.out
70
+
64
71
lint :
65
72
name : lint
66
73
runs-on : ubuntu-24.04
@@ -124,6 +131,21 @@ jobs:
124
131
exit 1
125
132
fi
126
133
134
+ coverage :
135
+ if : github.event_name == 'pull_request'
136
+ runs-on : ubuntu-latest
137
+ needs : test
138
+ permissions :
139
+ contents : read
140
+ actions : read
141
+ pull-requests : write
142
+ steps :
143
+ - uses : fgrosse/go-coverage-report@v1.2.0
144
+ with :
145
+ coverage-artifact-name : " code-coverage"
146
+ coverage-file-name : " coverage.out"
147
+ root-package : " github.com/xataio/pgroll"
148
+
127
149
code-generation :
128
150
name : code generation
129
151
runs-on : ubuntu-24.04
Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ bin/license-header-checker
4
4
.DS_Store
5
5
.env
6
6
pgroll
7
+ coverage.out
7
8
8
9
dist /
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ examples: ledger
36
36
@go clean
37
37
38
38
test :
39
- go test ./...
39
+ go test -coverprofile=coverage.out -cover ./...
40
40
41
41
bench :
42
42
go test ./internal/benchmarks -v -benchtime=1x -bench .
You can’t perform that action at this time.
0 commit comments