test: replace goacc with go test for coverage checks #247
Workflow file for this run
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: Build and Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
# go needs absolute directories, using the $HOME variable doesn't work here. | |
GOCACHE: /home/runner/work/go/pkg/build | |
GOPATH: /home/runner/work/go | |
GO_VERSION: 1.23.2 | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Check out source | |
uses: actions/checkout@v4 | |
- name: Build | |
run: make build | |
test-cover: | |
name: Unit coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Check out source | |
uses: actions/checkout@v4 | |
- name: Generate coverage info | |
run: make unit-cover | |
# Copy coverage files to the root directory to fix "Permission denied" error | |
- name: Copy coverage files | |
run: | | |
cp ./btcec/coverage.txt coverage-btcec.txt | |
cp ./btcutil/coverage.txt coverage-btcutil.txt | |
cp ./btcutil/psbt/coverage.txt coverage-btcutil-psbt.txt | |
- name: Send coverage | |
uses: coverallsapp/github-action@v2 | |
with: | |
files: | | |
coverage.txt | |
coverage-btcec.txt | |
coverage-btcutil.txt | |
coverage-btcutil-psbt.txt | |
format: golang | |
test-race: | |
name: Unit race | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Check out source | |
uses: actions/checkout@v4 | |
- name: Test | |
run: make unit-race |