Skip to content

Add GH pages coverage report #17

Add GH pages coverage report

Add GH pages coverage report #17

Workflow file for this run

name: CI/CD
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.23
- name: Install dependencies
run: go get -v -t ./...
- name: Build
run: go build -v ./...
- name: Test with coverage
run: |
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
go tool cover -html=coverage.out -o coverage.html
- name: Deploy coverage to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
publish_files: coverage.html