Skip to content

Commit 25d94ff

Browse files
authored
generate coverage profile
1 parent 7ea59f0 commit 25d94ff

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/ci.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
env:
206206
CGO_ENABLED: 0
207207
run: |
208-
go build -tags nobadger -trimpath -ldflags="-w -s" -v
208+
go build -cover -tags nobadger,nopgx,nomysql -trimpath -ldflags="-w -s" -v
209209
210210
- name: Install Hurl
211211
env:
@@ -217,6 +217,9 @@ jobs:
217217
218218
- name: Run Caddy
219219
run: |
220+
./cmd/caddy/caddy environ
221+
mkdir coverdir
222+
export GOCOVERDIR=./coverdir
220223
./cmd/caddy/caddy start
221224
222225
- name: Run tests with Hurl
@@ -230,6 +233,21 @@ jobs:
230233
files: |
231234
hurl-report/junit.xml
232235
236+
- name: Generate Coverage Data
237+
run: |
238+
export GOCOVERDIR=./coverdir
239+
./cmd/caddy/caddy stop
240+
go tool covdata textfmt -i=coverdir -o hurl-report/cover-profile.txt
241+
go tool cover -html hurl-report/cover-profile.txt -o hurl-report/cover.html
242+
243+
244+
- name: Publish Coverage Profile
245+
uses: actions/upload-artifact@v4
246+
with:
247+
name: caddy_cover_${{ steps.vars.outputs.short_sha }}.html
248+
path: "./hurl-report/cover.html"
249+
compression-level: 0
250+
233251
s390x-test:
234252
name: test (s390x on IBM Z)
235253
runs-on: ubuntu-latest

caddytest/spec/http/requestbody/spec.hurl

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ http://localhost:8000 {
2525

2626
GET https://localhost:9443
2727
[Options]
28+
delay: 1s
2829
insecure: true
2930
```
3031
Hello

0 commit comments

Comments
 (0)