add unit test report #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
name: Test with Coverage | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.22' ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install dependencies | |
run: | | |
go mod download | |
- name: Run Unit tests | |
run: | | |
go test -race -coverpkg=./... -covermode=atomic -coverprofile=covprofile | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: Send coverage | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: goveralls -coverprofile=covprofile -service=github |