Skip to content

Commit bc61c0e

Browse files
authored
Merge pull request #1381 from lightninglabs/ci-update
misc CI/build system improvements
2 parents c0165f7 + b35af18 commit bc61c0e

31 files changed

+92
-177
lines changed

.github/workflows/main.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
# go needs absolute directories, using the $HOME variable doesn't work here.
2020
GOPATH: /home/runner/work/go
2121

22-
GO_VERSION: '1.22.6'
22+
GO_VERSION: '1.22.12'
2323

2424
LITD_ITEST_BRANCH: 'master'
2525

@@ -232,6 +232,7 @@ jobs:
232232
- name: Send coverage
233233
uses: shogo82148/actions-goveralls@v1
234234
if: matrix.unit_type == 'unit-cover'
235+
continue-on-error: true
235236
with:
236237
path-to-profile: coverage.txt
237238
flag-name: 'unit'
@@ -251,7 +252,7 @@ jobs:
251252
uses: ./.github/actions/setup-go
252253

253254
- name: run itest
254-
run: make itest
255+
run: make itest cover=1
255256

256257
- name: Zip log files on failure
257258
if: ${{ failure() }}
@@ -265,6 +266,15 @@ jobs:
265266
path: logs-itest.zip
266267
retention-days: 5
267268

269+
- name: Send coverage
270+
uses: shogo82148/actions-goveralls@v1
271+
if: ${{ success() }}
272+
continue-on-error: true
273+
with:
274+
path-to-profile: itest/coverage.txt
275+
flag-name: 'itest'
276+
parallel: true
277+
268278
########################
269279
# run integration tests with Postgres backend
270280
########################
@@ -279,7 +289,7 @@ jobs:
279289
uses: ./.github/actions/setup-go
280290

281291
- name: run itest
282-
run: make itest dbbackend=postgres
292+
run: make itest dbbackend=postgres cover=1
283293

284294
- name: Zip log files on failure
285295
if: ${{ failure() }}
@@ -293,6 +303,15 @@ jobs:
293303
path: logs-itest-postgres.zip
294304
retention-days: 5
295305

306+
- name: Send coverage
307+
uses: shogo82148/actions-goveralls@v1
308+
if: ${{ success() }}
309+
continue-on-error: true
310+
with:
311+
path-to-profile: itest/coverage.txt
312+
flag-name: 'itest'
313+
parallel: true
314+
296315
########################
297316
# Run LiTd tests
298317
########################
@@ -347,5 +366,6 @@ jobs:
347366
runs-on: ubuntu-latest
348367
steps:
349368
- uses: shogo82148/actions-goveralls@v1
369+
continue-on-error: true
350370
with:
351371
parallel-finished: true

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defaults:
1010
shell: bash
1111

1212
env:
13-
GO_VERSION: 1.22.6
13+
GO_VERSION: 1.22.12
1414

1515
jobs:
1616
main:
@@ -136,8 +136,8 @@ jobs:
136136
```
137137
tar -xvzf vendor.tar.gz
138138
tar -xvzf tapd-source-${{ env.RELEASE_VERSION }}.tar.gz
139-
GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightninglabs/taproot-assets/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/tapd
140-
GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightninglabs/taproot-assets/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/tapcli
139+
go install -v -mod=vendor -ldflags "-X github.com/lightninglabs/taproot-assets/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/tapd
140+
go install -v -mod=vendor -ldflags "-X github.com/lightninglabs/taproot-assets/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/tapcli
141141
```
142142
143143
The `-mod=vendor` flag tells the `go build` command that it doesn't need to fetch the dependencies, and instead, they're all enclosed in the local vendor directory.

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ issues:
7272
- unused
7373
- deadcode
7474
- varcheck
75-
new-from-rev: c723abd3c9db8a6a2f3f1eaa85ce5aefb52c8170
75+
new-from-rev: 002f4ac35f343797e0a1a07a505c65a94d9dd4b3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.6-alpine as builder
1+
FROM golang:1.22.12-alpine as builder
22

33
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
44
# queries required to connect to linked containers succeed.

Makefile

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ PKG := github.com/lightninglabs/taproot-assets
22

33
BTCD_PKG := github.com/btcsuite/btcd
44
LND_PKG := github.com/lightningnetwork/lnd
5-
GOACC_PKG := github.com/ory/go-acc
65
GOIMPORTS_PKG := github.com/rinchsan/gosimports/cmd/gosimports
76
TOOLS_DIR := tools
87

98
GO_BIN := ${GOPATH}/bin
10-
GOACC_BIN := $(GO_BIN)/go-acc
119
GOIMPORTS_BIN := $(GO_BIN)/gosimports
1210
MIGRATE_BIN := $(GO_BIN)/migrate
1311

@@ -16,10 +14,10 @@ VERSION_GO_FILE := "version.go"
1614

1715
COMMIT := $(shell git describe --tags --dirty --always)
1816

19-
GOBUILD := GOEXPERIMENT=loopvar GO111MODULE=on go build -v
20-
GOINSTALL := GOEXPERIMENT=loopvar GO111MODULE=on go install -v
21-
GOTEST := GOEXPERIMENT=loopvar GO111MODULE=on go test
22-
GOMOD := GO111MODULE=on go mod
17+
GOBUILD := go build -v
18+
GOINSTALL := go install -v
19+
GOTEST := go test
20+
GOMOD := go mod
2321

2422
GOLIST := go list -deps $(PKG)/... | grep '$(PKG)'
2523
GOLIST_COVER := $$(go list -deps $(PKG)/... | grep '$(PKG)')
@@ -56,9 +54,10 @@ endif
5654
DOCKER_TOOLS = docker run \
5755
-v $(shell bash -c "go env GOCACHE || (mkdir -p /tmp/go-cache; echo /tmp/go-cache)"):/tmp/build/.cache \
5856
-v $(shell bash -c "go env GOMODCACHE || (mkdir -p /tmp/go-modcache; echo /tmp/go-modcache)"):/tmp/build/.modcache \
57+
-v $(shell bash -c "mkdir -p /tmp/go-lint-cache; echo /tmp/go-lint-cache"):/root/.cache/golangci-lint \
5958
-v $$(pwd):/build taproot-assets-tools
6059

61-
GO_VERSION = 1.22.6
60+
GO_VERSION = 1.22.12
6261

6362
GREEN := "\\033[0;32m"
6463
NC := "\\033[0m"
@@ -74,10 +73,6 @@ all: scratch check install
7473
# DEPENDENCIES
7574
# ============
7675

77-
$(GOACC_BIN):
78-
@$(call print, "Installing go-acc.")
79-
cd $(TOOLS_DIR); go install -trimpath $(GOACC_PKG)
80-
8176
$(GOIMPORTS_BIN):
8277
@$(call print, "Installing goimports.")
8378
cd $(TOOLS_DIR); go install -trimpath $(GOIMPORTS_PKG)
@@ -187,9 +182,9 @@ unit-trace:
187182
@$(call print, "Running unit tests in trace mode (enabling package loggers on level trace).")
188183
$(UNIT_TRACE)
189184

190-
unit-cover: $(GOACC_BIN)
185+
unit-cover:
191186
@$(call print, "Running unit coverage tests.")
192-
$(GOACC); $(COVER_HTML)
187+
$(UNIT_COVER)
193188

194189
unit-race:
195190
@$(call print, "Running unit race tests.")
@@ -202,7 +197,7 @@ itest-trace: build-itest itest-only-trace
202197
itest-only: aperture-dir
203198
@$(call print, "Running integration tests with ${backend} backend.")
204199
rm -rf itest/regtest; date
205-
$(GOTEST) ./itest -v -tags="$(ITEST_TAGS)" $(TEST_FLAGS) $(ITEST_FLAGS) -btcdexec=./btcd-itest -logdir=regtest
200+
$(GOTEST) ./itest -v $(ITEST_COVERAGE) -tags="$(ITEST_TAGS)" $(TEST_FLAGS) $(ITEST_FLAGS) -btcdexec=./btcd-itest -logdir=regtest
206201

207202
itest-only-trace: aperture-dir
208203
@$(call print, "Running integration tests with ${backend} backend.")
@@ -350,6 +345,14 @@ migration-check:
350345
clean:
351346
@$(call print, "Cleaning source.$(NC)")
352347
$(RM) coverage.txt
348+
$(RM) -r itest/regtest
349+
$(RM) -r itest/chantools
350+
$(RM) itest/btcd-itest
351+
$(RM) itest/lnd-itest
352+
$(RM) loadtest
353+
$(RM) tapd-debug
354+
$(RM) tapcli-debug
355+
$(RM) -r taproot-assets-v*
353356

354357
.PHONY: all \
355358
default \

dev.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.6 as builder
1+
FROM golang:1.22.12 as builder
22

33
WORKDIR /app
44

docs/examples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GOBUILD := GOEXPERIMENT=loopvar GO111MODULE=on go build -v
1+
GOBUILD := go build -v
22

33
build:
44
cd ./basic-price-oracle && $(GOBUILD)

docs/examples/basic-price-oracle/go.mod

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ require (
7474
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
7575
github.com/hashicorp/errwrap v1.1.0 // indirect
7676
github.com/hashicorp/go-multierror v1.1.1 // indirect
77-
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
7877
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
7978
github.com/jackc/pgconn v1.14.3 // indirect
8079
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 // indirect
@@ -179,13 +178,10 @@ require (
179178
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
180179
gopkg.in/yaml.v2 v2.4.0 // indirect
181180
gopkg.in/yaml.v3 v3.0.1 // indirect
182-
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
183-
modernc.org/libc v1.50.9 // indirect
181+
modernc.org/libc v1.55.3 // indirect
184182
modernc.org/mathutil v1.6.0 // indirect
185183
modernc.org/memory v1.8.0 // indirect
186-
modernc.org/sqlite v1.30.0 // indirect
187-
modernc.org/strutil v1.2.0 // indirect
188-
modernc.org/token v1.1.0 // indirect
184+
modernc.org/sqlite v1.34.5 // indirect
189185
pgregory.net/rapid v1.1.0 // indirect
190186
sigs.k8s.io/yaml v1.2.0 // indirect
191187
)

docs/examples/basic-price-oracle/go.sum

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
308308
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
309309
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
310310
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
311-
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
312-
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
313311
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
314312
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
315313
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
@@ -1050,18 +1048,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
10501048
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
10511049
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
10521050
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
1053-
modernc.org/cc/v4 v4.21.2 h1:dycHFB/jDc3IyacKipCNSDrjIC0Lm1hyoWOZTRR20Lk=
1054-
modernc.org/cc/v4 v4.21.2/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
1055-
modernc.org/ccgo/v4 v4.17.8 h1:yyWBf2ipA0Y9GGz/MmCmi3EFpKgeS7ICrAFes+suEbs=
1056-
modernc.org/ccgo/v4 v4.17.8/go.mod h1:buJnJ6Fn0tyAdP/dqePbrrvLyr6qslFfTbFrCuaYvtA=
1051+
modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ=
1052+
modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
1053+
modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y=
1054+
modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s=
10571055
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
10581056
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
10591057
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
10601058
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
1061-
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI=
1062-
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
1063-
modernc.org/libc v1.50.9 h1:hIWf1uz55lorXQhfoEoezdUHjxzuO6ceshET/yWjSjk=
1064-
modernc.org/libc v1.50.9/go.mod h1:15P6ublJ9FJR8YQCGy8DeQ2Uwur7iW9Hserr/T3OFZE=
1059+
modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U=
1060+
modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w=
10651061
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
10661062
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
10671063
modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
@@ -1070,8 +1066,8 @@ modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
10701066
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
10711067
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
10721068
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
1073-
modernc.org/sqlite v1.30.0 h1:8YhPUs/HTnlEgErn/jSYQTwHN/ex8CjHHjg+K9iG7LM=
1074-
modernc.org/sqlite v1.30.0/go.mod h1:cgkTARJ9ugeXSNaLBPK3CqbOe7Ec7ZhWPoMFGldEYEw=
1069+
modernc.org/sqlite v1.34.5 h1:Bb6SR13/fjp15jt70CL4f18JIN7p7dnMExd+UFnF15g=
1070+
modernc.org/sqlite v1.34.5/go.mod h1:YLuNmX9NKs8wRNK2ko1LW1NGYcc9FkBO69JOt1AR9JE=
10751071
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
10761072
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
10771073
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=

go.mod

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ require (
4747
google.golang.org/protobuf v1.33.0
4848
gopkg.in/macaroon-bakery.v2 v2.1.0
4949
gopkg.in/macaroon.v2 v2.1.0
50-
modernc.org/sqlite v1.30.0
50+
modernc.org/sqlite v1.34.5
5151
pgregory.net/rapid v1.1.0
5252
)
5353

@@ -100,7 +100,6 @@ require (
100100
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
101101
github.com/hashicorp/errwrap v1.1.0 // indirect
102102
github.com/hashicorp/go-multierror v1.1.1 // indirect
103-
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
104103
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
105104
github.com/jackc/pgio v1.0.0 // indirect
106105
github.com/jackc/pgpassfile v1.0.0 // indirect
@@ -198,12 +197,9 @@ require (
198197
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
199198
gopkg.in/yaml.v2 v2.4.0 // indirect
200199
gopkg.in/yaml.v3 v3.0.1 // indirect
201-
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
202-
modernc.org/libc v1.50.9 // indirect
200+
modernc.org/libc v1.55.3 // indirect
203201
modernc.org/mathutil v1.6.0 // indirect
204202
modernc.org/memory v1.8.0 // indirect
205-
modernc.org/strutil v1.2.0 // indirect
206-
modernc.org/token v1.1.0 // indirect
207203
nhooyr.io/websocket v1.8.7 // indirect
208204
sigs.k8s.io/yaml v1.2.0 // indirect
209205
)

0 commit comments

Comments
 (0)