Skip to content

test: improve test coverage (#114) #255

test: improve test coverage (#114)

test: improve test coverage (#114) #255

Workflow file for this run

name: Traverse Continuous Integration
on:
push:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.23
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.60.3
args: --verbose
test:
strategy:
matrix:
go-version: [1.23]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Install ginkgo
run: go install github.com/onsi/ginkgo/v2/[email protected]
- name: Checkout code
uses: actions/checkout@v4
# - name: List coverage directory
# run: ls -la ${{ github.workspace }}/coverage
- name: Ensure coverage directory exists
run: mkdir -p ${{ github.workspace }}/coverage
- name: run coverage with ginkgo
run: |
ginkgo ./... --json-report ./ginkgo.report -coverpkg=./... \
-coverprofile=${{ github.workspace }}/coverage/coverage.out -r
- name: Check coverage directory contents
run: ls -la ${{ github.workspace }}/coverage
- name: run go cover tool
run: |
go tool cover -o ${{ github.workspace }}/coverage/coverage.html \
-html=${{ github.workspace }}/coverage/coverage.out
# - run: go test -v -coverprofile=profile.cov ./...
- name: Recheck coverage directory
run: ls -la ${{ github.workspace }}/coverage
- name: foo
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: ${{ github.workspace }}/coverage/coverage.out
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=${{ github.workspace }}/coverage/coverage.out -service=github