2020-05-13 08:44:07 -04:00
|
|
|
name: Build and Test
|
|
|
|
on: [push, pull_request]
|
2021-12-24 16:48:35 -08:00
|
|
|
|
|
|
|
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.17.5
|
|
|
|
|
2020-05-13 08:44:07 -04:00
|
|
|
jobs:
|
|
|
|
build:
|
2021-12-24 16:48:35 -08:00
|
|
|
name: Build
|
2020-05-13 08:44:07 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-12-24 16:48:35 -08:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
|
2020-05-13 08:44:07 -04:00
|
|
|
- name: Check out source
|
|
|
|
uses: actions/checkout@v2
|
2021-12-24 16:48:35 -08:00
|
|
|
|
2020-05-13 08:44:07 -04:00
|
|
|
- name: Build
|
2021-12-24 16:48:35 -08:00
|
|
|
run: make build
|
|
|
|
|
|
|
|
test-cover:
|
|
|
|
name: Unit coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
|
|
|
|
- name: Check out source
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-05-13 08:44:07 -04:00
|
|
|
- name: Test
|
2021-12-24 16:48:35 -08:00
|
|
|
run: make unit-cover
|
2020-08-24 20:58:47 +02:00
|
|
|
|
2021-12-24 16:48:35 -08:00
|
|
|
- name: Send top-level coverage
|
2020-08-24 20:58:47 +02:00
|
|
|
uses: shogo82148/actions-goveralls@v1
|
|
|
|
with:
|
2021-12-24 16:48:35 -08:00
|
|
|
path-to-profile: coverage.txt
|
2022-02-22 14:59:23 +00:00
|
|
|
flag-name: btcd
|
|
|
|
parallel: true
|
2021-12-24 16:48:35 -08:00
|
|
|
|
2021-11-18 18:43:53 -08:00
|
|
|
- name: Send btcec
|
|
|
|
uses: shogo82148/actions-goveralls@v1
|
|
|
|
with:
|
|
|
|
path-to-profile: btcec/coverage.txt
|
2022-02-22 14:59:23 +00:00
|
|
|
flag-name: btcec
|
|
|
|
parallel: true
|
2021-11-18 18:43:53 -08:00
|
|
|
|
2021-12-24 16:48:35 -08:00
|
|
|
- name: Send btcutil coverage
|
|
|
|
uses: shogo82148/actions-goveralls@v1
|
|
|
|
with:
|
|
|
|
path-to-profile: btcutil/coverage.txt
|
2022-02-22 14:59:23 +00:00
|
|
|
flag-name: btcutil
|
|
|
|
parallel: true
|
2021-12-24 16:48:35 -08:00
|
|
|
|
|
|
|
- name: Send btcutil coverage for psbt package
|
|
|
|
uses: shogo82148/actions-goveralls@v1
|
|
|
|
with:
|
|
|
|
path-to-profile: btcutil/psbt/coverage.txt
|
2022-02-22 14:59:23 +00:00
|
|
|
flag-name: btcutilpsbt
|
|
|
|
parallel: true
|
|
|
|
|
|
|
|
- name: Notify coveralls all reports sent
|
|
|
|
uses: shogo82148/actions-goveralls@v1
|
|
|
|
with:
|
|
|
|
parallel-finished: true
|
2021-12-24 16:48:35 -08:00
|
|
|
|
|
|
|
test-race:
|
|
|
|
name: Unit race
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
|
|
|
|
- name: Check out source
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: make unit-race
|