btcd/.github/workflows/main.yml
Calvin Kim 61c215ec1a ci: run rpctest integration tests
`make build`, `make unit-cover`, and `make unit-race` all use plain
`go test` without the rpctest build tag, so anything under
//go:build rpctest -- the entire integration/ package outside of
rpctest/, and parts of rpctest/ itself -- is not exercised by CI.
Bugs that only surface under -tags=rpctest can land on master without
detection.

Add a test-rpctest job that runs `make unit` (which sets
-tags=rpctest) so rpctest-tagged tests are part of every push and PR.
2026-05-30 16:47:18 +09:00

162 lines
3.8 KiB
YAML

name: Build and Test
on: [push, pull_request]
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
GOBIN: /home/runner/work/go/bin
GO_VERSION: 1.26.3
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
- name: Cross-compile (android/arm64)
env:
GOOS: android
GOARCH: arm64
run: |
go build ./...
(cd btcutil && go 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: Test
run: make unit-cover
- name: Send top-level coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: coverage.txt
flag-name: btcd
format: 'golang'
parallel: true
- name: Send address coverage
uses: coverallsapp/github-action@v2
with:
file: address/coverage.txt
flag-name: address
format: 'golang'
parallel: true
- name: Send btcec coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: btcec/coverage.txt
flag-name: btcec
format: 'golang'
parallel: true
- name: Send chaincfg coverage
uses: coverallsapp/github-action@v2
with:
file: chaincfg/coverage.txt
flag-name: chaincfg
format: 'golang'
parallel: true
- name: Send chainhash coverage
uses: coverallsapp/github-action@v2
with:
file: chainhash/coverage.txt
flag-name: chainhash
format: 'golang'
parallel: true
- name: Send btcutil coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: btcutil/coverage.txt
flag-name: btcutil
format: 'golang'
parallel: true
- name: Send psbt coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: psbt/coverage.txt
flag-name: psbt
format: 'golang'
parallel: true
- name: Send txscript coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: txscript/coverage.txt
flag-name: txscript
format: 'golang'
parallel: true
- name: Send wire coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: wire/coverage.txt
flag-name: wire
format: 'golang'
parallel: true
- name: Notify coveralls all reports sent
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
parallel-finished: true
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
test-rpctest:
name: Unit rpctest
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