generate coverage profile

This commit is contained in:
Mohammed Al Sahaf 2024-10-29 21:37:09 +00:00 committed by GitHub
parent 7ea59f0d49
commit 25d94ffe2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View file

@ -205,7 +205,7 @@ jobs:
env: env:
CGO_ENABLED: 0 CGO_ENABLED: 0
run: | run: |
go build -tags nobadger -trimpath -ldflags="-w -s" -v go build -cover -tags nobadger,nopgx,nomysql -trimpath -ldflags="-w -s" -v
- name: Install Hurl - name: Install Hurl
env: env:
@ -217,6 +217,9 @@ jobs:
- name: Run Caddy - name: Run Caddy
run: | run: |
./cmd/caddy/caddy environ
mkdir coverdir
export GOCOVERDIR=./coverdir
./cmd/caddy/caddy start ./cmd/caddy/caddy start
- name: Run tests with Hurl - name: Run tests with Hurl
@ -230,6 +233,21 @@ jobs:
files: | files: |
hurl-report/junit.xml hurl-report/junit.xml
- name: Generate Coverage Data
run: |
export GOCOVERDIR=./coverdir
./cmd/caddy/caddy stop
go tool covdata textfmt -i=coverdir -o hurl-report/cover-profile.txt
go tool cover -html hurl-report/cover-profile.txt -o hurl-report/cover.html
- name: Publish Coverage Profile
uses: actions/upload-artifact@v4
with:
name: caddy_cover_${{ steps.vars.outputs.short_sha }}.html
path: "./hurl-report/cover.html"
compression-level: 0
s390x-test: s390x-test:
name: test (s390x on IBM Z) name: test (s390x on IBM Z)
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -25,6 +25,7 @@ http://localhost:8000 {
GET https://localhost:9443 GET https://localhost:9443
[Options] [Options]
delay: 1s
insecure: true insecure: true
``` ```
Hello Hello