Skip to content

Commit ac88e97

Browse files
committed
Tries to fix remote testing
1 parent 5e75bca commit ac88e97

File tree

12 files changed

+177
-66
lines changed

12 files changed

+177
-66
lines changed

.github/workflows/build-and-test.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ env:
44
CHIFRA_PATH: src/apps/chifra
55
KHEDRA_PATH: khedra
66
# Go Version
7-
GO_VERSION: 1.23.1
7+
GO_VERSION: 1.25.1
88
jobs:
99
Lint:
1010
runs-on: ubuntu-latest
@@ -21,19 +21,17 @@ jobs:
2121
run: |
2222
./scripts/go-work-sync.sh
2323
- name: Lint chifra
24-
uses: golangci/golangci-lint-action@v4
24+
uses: golangci/golangci-lint-action@v8
2525
with:
26-
version: v1.61.0
26+
version: v2.4.0
2727
working-directory: ${{ env.CHIFRA_PATH }}
28-
args: --timeout=5m --verbose --out-format=colored-line-number
29-
skip-pkg-cache: true
28+
args: --timeout=5m --verbose --output.text.colors=true --output.text.print-linter-name=true
3029
- name: Lint khedra
31-
uses: golangci/golangci-lint-action@v4
30+
uses: golangci/golangci-lint-action@v8
3231
with:
33-
version: v1.61.0
32+
version: v2.4.0
3433
working-directory: ${{ env.KHEDRA_PATH }}
35-
args: --timeout=5m --verbose --out-format=colored-line-number
36-
skip-pkg-cache: true
34+
args: --timeout=5m --verbose --output.text.colors=true --output.text.print-linter-name=true
3735
Build:
3836
needs: Lint
3937
runs-on: ubuntu-latest
@@ -50,11 +48,12 @@ jobs:
5048
- name: Install prerequistes
5149
run: |
5250
sudo apt-mark hold grub-efi-amd64-signed
53-
sudo apt-get update --fix-missing
54-
sudo apt-get upgrade
55-
sudo apt-get install build-essential git cmake
56-
sudo apt-get install python3 tree jq
57-
sudo apt-get install libcurl3-dev
51+
sudo apt-mark hold firefox
52+
sudo apt-get update --fix-missing || true
53+
sudo apt-get upgrade -y --fix-missing || true
54+
sudo apt-get install -y build-essential git cmake
55+
sudo apt-get install -y python3 tree jq
56+
sudo apt-get install -y libcurl3-dev
5857
- name: Run chifra unit tests
5958
run: |
6059
mkdir -p build
@@ -68,19 +67,20 @@ jobs:
6867
export TB_NO_PROVIDER_CHECK=true
6968
go test ./...
7069
cd ../../../
71-
cd ${{ env.KHEDRA_PATH }}
72-
export TB_NO_PROVIDER_CHECK=true
73-
go test ./...
70+
# cd ${{ env.KHEDRA_PATH }}
71+
# export TB_NO_PROVIDER_CHECK=true
72+
# go test ./...
7473
RemoteTests:
7574
needs: Build
7675
runs-on: ubuntu-latest
7776
steps:
7877
- name: Run tests remotely
79-
uses: appleboy/ssh-action@master
78+
uses: appleboy/ssh-action@v1.0.3
8079
with:
81-
host: ${{ secrets.TESTING_HOST }}
82-
username: ${{ secrets.TESTING_USERNAME }}
83-
key: ${{ secrets.SSH_PRIVATE_KEY }}
80+
# These secrets are configured in the repository settings
81+
host: ${{ secrets.TESTING_HOST }} # Remote testing server hostname
82+
username: ${{ secrets.TESTING_USERNAME }} # SSH username for remote testing
83+
key: ${{ secrets.SSH_PRIVATE_KEY }} # SSH private key for authentication
8484
command_timeout: 40m
8585
script: |
8686
set -e # Exit on any error
@@ -93,6 +93,7 @@ jobs:
9393
git checkout ${{ github.head_ref }}
9494
git submodule update --init --recursive
9595
cd scripts
96+
bash check_go_version.sh ${{ env.GO_VERSION }}
9697
if CONFIG_FILE=$HOME/trueBlocks.toml bash test-with-docker.sh ${{ github.repository }} ${{ github.sha }} ${{ github.head_ref }}; then
9798
echo "✅ Tests passed successfully"
9899
echo "Results placed in /home/testuser/testing/${{ github.sha }}"

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/setup-go@v1
1818
with:
1919
# Go Version
20-
go-version: '1.23.1'
20+
go-version: '1.25.1'
2121
- name: Run GoReleaser
2222
uses: goreleaser/goreleaser-action@v2
2323
with:

docs/content/docs/install/install-core.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you need help with a particular step, see the [installation's troubleshooting
2525

2626
- Open a terminal window.
2727

28-
- Type `go version`. If Go is not installed or less than Go Version 1.23, [install the latest version of Go](https://go.dev/doc/install)
28+
- Type `go version`. If Go is not installed or less than Go Version 1.25.1, [install the latest version of Go](https://go.dev/doc/install)
2929

3030
- Install or upgrade the build dependencies: _git_, _cmake_, _ninja_, _curl_, _python_, _clang-format_, _jq_
3131

docs/content/docs/install/install-troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ This section lists solutions to problems some users have run into with the insta
1919

2020
### Installing go
2121

22-
#### How do I check my Go version?
22+
#### How do I check my Go Version?
2323

2424
Run this command
2525

2626
```shell
2727
go version
2828
```
2929

30-
TrueBlocks needs version 1.16.x or later. If you to install or update Go, [see here](https://golang.org/doc/install).
30+
TrueBlocks needs version 1.25.1 or later. If you to install or update Go, [see here](https://golang.org/doc/install).
3131

3232
### Installing build tools
3333

scripts/Dockerfile

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Go Version
2-
FROM golang:1.23.1-bullseye
2+
FROM golang:1.25.1-bookworm
33

44
# Declare build arguments so they're visible inside the Dockerfile
55
ARG repo
@@ -13,18 +13,41 @@ RUN set -eux ; apt install -y curl bash linux-headers-amd64 xz-utils jq unzip
1313
# Switch into /root
1414
WORKDIR /root
1515

16-
# Debug: confirm we have the correct values
17-
RUN echo "DEBUG: repo=${repo}, branch=${branch} commit_sha=${commit_sha}"
16+
# Debug: confirm we have the correct values and show environment
17+
RUN echo "=== BUILD ARGUMENTS ===" && \
18+
echo "repo=${repo}" && \
19+
echo "branch=${branch}" && \
20+
echo "commit_sha=${commit_sha}" && \
21+
echo "PWD=$(pwd)" && \
22+
echo "=== END BUILD ARGUMENTS ==="
1823

1924
# 1) Clone
2025
RUN set -eux ; git clone --progress "https://github.com/${repo}.git" /root/trueblocks-core
2126

2227
# 2) Move into the cloned repo
2328
WORKDIR /root/trueblocks-core
2429

30+
# Debug: Show current directory and contents
31+
RUN echo "=== POST-CLONE DEBUG ===" && \
32+
echo "PWD=$(pwd)" && \
33+
echo "Directory contents:" && \
34+
ls -la && \
35+
echo "Git status:" && \
36+
git status && \
37+
echo "=== END POST-CLONE DEBUG ==="
38+
2539
# 3) Check out the desired branch
2640
RUN set -eux ; git checkout "${branch}"
2741

42+
# Debug: Show git status after checkout
43+
RUN echo "=== POST-CHECKOUT DEBUG ===" && \
44+
echo "PWD=$(pwd)" && \
45+
echo "Current branch:" && \
46+
git branch && \
47+
echo "Git status:" && \
48+
git status && \
49+
echo "=== END POST-CHECKOUT DEBUG ==="
50+
2851
# 4) Update/init submodules
2952
RUN set -eux ; git submodule update --init --recursive
3053

@@ -34,14 +57,45 @@ RUN set -eux ; mkdir -v build
3457
# 6) Switch into that folder
3558
WORKDIR /root/trueblocks-core/build
3659

60+
# Debug: Show build directory setup
61+
RUN echo "=== BUILD DIRECTORY DEBUG ===" && \
62+
echo "PWD=$(pwd)" && \
63+
echo "Build directory contents:" && \
64+
ls -la && \
65+
echo "Parent directory contents:" && \
66+
ls -la ../ && \
67+
echo "scripts directory check:" && \
68+
ls -la ../scripts/ && \
69+
echo "=== END BUILD DIRECTORY DEBUG ==="
70+
3771
# 7) Optionally sync go.work modules (if your script does that)
38-
RUN set -eux ; ../scripts/go-work-sync.sh
72+
RUN echo "=== RUNNING go-work-sync.sh ===" && \
73+
../scripts/go-work-sync.sh 2>&1 | tee /tmp/go-work-sync.log && \
74+
echo "=== go-work-sync.sh completed ==="
75+
76+
# 8) Run CMake with better error reporting
77+
RUN echo "=== RUNNING CMAKE ===" && \
78+
cmake ../src 2>&1 | tee /tmp/cmake.log || \
79+
(echo "CMAKE FAILED - Contents of cmake.log:" && cat /tmp/cmake.log && exit 1)
3980

40-
# 8) Run CMake
41-
RUN set -eux ; cmake ../src
81+
# 9) Run make with verbose output and better error reporting
82+
RUN echo "=== RUNNING MAKE ===" && \
83+
make VERBOSE=1 -j1 2>&1 | tee /tmp/make.log || \
84+
(echo "MAKE FAILED - Last 50 lines of make.log:" && tail -50 /tmp/make.log && exit 1)
4285

43-
# 9) Run make (compile)
44-
RUN set -eux ; make -j4
86+
# Debug final setup before entrypoint
87+
RUN echo "=== FINAL CONTAINER SETUP ===" && \
88+
echo "Build directory contents:" && \
89+
ls -la && \
90+
echo "Makefile check:" && \
91+
(ls -la Makefile || echo "No Makefile found") && \
92+
echo "test-all target check:" && \
93+
(make -n test-all 2>&1 | head -10 || echo "Cannot check test-all target") && \
94+
echo "scripts directory:" && \
95+
(ls -la ../scripts/ | head -10 || echo "Cannot list scripts directory") && \
96+
echo "build-and-test.sh permissions:" && \
97+
(ls -la ../scripts/build-and-test.sh || echo "Cannot find build-and-test.sh") && \
98+
echo "=== END FINAL SETUP ==="
4599

46100
# Finally, define your entrypoint (if you want to run tests or something)
47101
ENTRYPOINT ["bash", "/root/trueblocks-core/scripts/build-and-test.sh"]

scripts/check_go_version.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
3+
# Name: check_go_version.sh
4+
# Purpose: Check that the Go version in Dockerfile matches the required version of Go
5+
6+
#------------------------------------------------
7+
# Check if required version parameter is provided
8+
if [ $# -ne 1 ]; then
9+
echo "❌ ERROR: Usage: $0 <required_go_version>"
10+
echo " Example: $0 1.25.1"
11+
exit 1
12+
fi
13+
14+
REQUIRED_GO_VERSION="$1"
15+
16+
#------------------------------------------------
17+
# Get the directory where the script is located
18+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19+
DOCKERFILE_PATH="$SCRIPT_DIR/Dockerfile"
20+
21+
#------------------------------------------------
22+
# Check if Dockerfile exists
23+
if [ ! -f "$DOCKERFILE_PATH" ]; then
24+
echo "❌ ERROR: Dockerfile not found at $DOCKERFILE_PATH"
25+
exit 1
26+
fi
27+
28+
#------------------------------------------------
29+
# Extract Go version from Dockerfile FROM line
30+
DOCKER_GO_VERSION=$(grep "FROM golang:" "$DOCKERFILE_PATH" | grep -o '[0-9][0-9.]*' | head -1)
31+
32+
if [ -z "$DOCKER_GO_VERSION" ]; then
33+
echo "❌ ERROR: Could not extract Go version from Dockerfile"
34+
echo " Looking for line starting with 'FROM golang:' in $DOCKERFILE_PATH"
35+
exit 1
36+
fi
37+
38+
#------------------------------------------------
39+
# Compare versions
40+
echo "🔍 Checking Go version compatibility..."
41+
echo " Required version: $REQUIRED_GO_VERSION"
42+
echo " Dockerfile version: $DOCKER_GO_VERSION"
43+
44+
if [ "$DOCKER_GO_VERSION" != "$REQUIRED_GO_VERSION" ]; then
45+
echo "❌ CRITICAL ERROR: Go version mismatch!"
46+
echo " Workflow expects: $REQUIRED_GO_VERSION"
47+
echo " Dockerfile has: $DOCKER_GO_VERSION"
48+
echo " Please update $DOCKERFILE_PATH FROM line to use golang:$REQUIRED_GO_VERSION-bullseye"
49+
exit 1
50+
fi
51+
52+
echo "✅ Go version check passed"
53+
exit 0

scripts/go-work-sync.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GO_WORK_FILE="go.work"
3232
rm -f "$GO_WORK_FILE"
3333
if [ ! -f "$GO_WORK_FILE" ]; then
3434
echo "// Go Version" > "$GO_WORK_FILE"
35-
echo "go 1.23.1" >> "$GO_WORK_FILE"
35+
echo "go 1.25.1" >> "$GO_WORK_FILE"
3636
fi
3737

3838
#------------------------------------------------
@@ -46,24 +46,24 @@ find . -type f -name 'go.mod' | while read -r modfile; do
4646
echo " Updated $moddir/go.mod"
4747
cd "$moddir" || exit
4848

49-
isSdk="[ "$moddir" == "./sdk" ]"
50-
isChifra="[ "$moddir" == "./src/apps/chifra" ]"
51-
isGoMaker="[ "$moddir" == "./src/dev_tools/goMaker" ]"
52-
isNode="[ "$moddir" == "./node" ]"
53-
isFourbyte="[ "$moddir" == "./examples/four_bytes" ]"
54-
isKeystore="[ "$moddir" == "./examples/keystore" ]"
55-
isIndexMan="[ "$moddir" == "./src/dev_tools/indexManager" ]"
56-
isSimple="[ "$moddir" == "./examples/simple" ]"
49+
if [ "$moddir" = "./sdk" ]; then isSdk=true; else isSdk=false; fi
50+
if [ "$moddir" = "./src/apps/chifra" ]; then isChifra=true; else isChifra=false; fi
51+
if [ "$moddir" = "./src/dev_tools/goMaker" ]; then isGoMaker=true; else isGoMaker=false; fi
52+
if [ "$moddir" = "./node" ]; then isNode=true; else isNode=false; fi
53+
if [ "$moddir" = "./examples/four_bytes" ]; then isFourbyte=true; else isFourbyte=false; fi
54+
if [ "$moddir" = "./examples/keystore" ]; then isKeystore=true; else isKeystore=false; fi
55+
if [ "$moddir" = "./src/dev_tools/indexManager" ]; then isIndexMan=true; else isIndexMan=false; fi
56+
if [ "$moddir" = "./examples/simple" ]; then isSimple=true; else isSimple=false; fi
5757

58-
if $isGoMaker || $isNode || $isFourbyte; then
58+
if [ "$isGoMaker" = true ] || [ "$isNode" = true ] || [ "$isFourbyte" = true ]; then
5959
go get github.com/btcsuite/btcd 2> /dev/null
6060
fi
6161

62-
if ! $isSdk && ! $isChifra && ! $isGoMaker && ! $isFourbyte && ! $isIndexMan && ! $isKeystore; then
62+
if [ "$isSdk" = false ] && [ "$isChifra" = false ] && [ "$isGoMaker" = false ] && [ "$isFourbyte" = false ] && [ "$isIndexMan" = false ] && [ "$isKeystore" = false ]; then
6363
go get github.com/TrueBlocks/trueblocks-sdk/v5@latest
6464
fi
6565

66-
if ! $isChifra; then
66+
if [ "$isChifra" = false ]; then
6767
go get github.com/TrueBlocks/trueblocks-core/src/apps/chifra@latest
6868
fi
6969

scripts/test-with-docker.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,23 @@ if [ ! -f "Dockerfile" ]; then
3232
echo "Dockerfile does not exist in the current directory $(pwd)."
3333
exit 1
3434
fi
35-
IMAGE_ID=$(docker build -q \
35+
echo "Running docker build with full output..."
36+
docker build \
3637
--build-arg repo="$REPO" \
3738
--build-arg commit_sha="$COMMIT_SHA" \
3839
--build-arg branch="$BRANCH" \
39-
.)
40+
-t "trueblocks-test:$COMMIT_SHA" \
41+
.
4042

4143
RESULT=$?
42-
echo "IMAGE_ID=$IMAGE_ID"
43-
echo "RESULT=$RESULT"
44-
4544
if [ $RESULT -ne 0 ]; then
4645
echo "Failed to build Docker image."
4746
exit 1
4847
fi
4948

49+
IMAGE_ID="trueblocks-test:$COMMIT_SHA"
50+
echo "IMAGE_ID=$IMAGE_ID"
51+
5052
#------------------------------------------------
5153
echo "Running the docker image..."
5254
docker run \

src/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,21 @@ string(REGEX MATCH "go([0-9]+)\\.([0-9]+)\\.[0-9]+"
3939
GO_VERSION_MATCH "${GO_VERSION_OUTPUT}")
4040

4141
if(NOT GO_VERSION_MATCH)
42-
message(STATUS "${CColor}Could not determine Go version from output: \
42+
message(STATUS "${CColor}Could not determine Go Version from output: \
4343
${GO_VERSION_OUTPUT}.${COff}")
4444
message(STATUS "${CColor}Please install Go from \
4545
https://golang.org/doc/install.${COff}")
4646
return()
4747
endif()
4848

49+
# Go Version -- NOTE THE LESS 25 marker
50+
#
4951
set(GO_MAJOR_VERSION ${CMAKE_MATCH_1})
5052
set(GO_MINOR_VERSION ${CMAKE_MATCH_2})
5153
if(GO_MAJOR_VERSION LESS 1 OR
52-
(GO_MAJOR_VERSION EQUAL 1 AND GO_MINOR_VERSION LESS 23))
54+
(GO_MAJOR_VERSION EQUAL 1 AND GO_MINOR_VERSION LESS 25))
5355
message(STATUS "${CColor}The build failed.${COff}")
54-
message(STATUS "${CColor}Found ${GO_VERSION_OUTPUT}. Go Version 1.23.1 or "
56+
message(STATUS "${CColor}Found ${GO_VERSION_OUTPUT}. Go Version 1.25.1 or "
5557
"higher is required.${COff}")
5658
message(STATUS "${CColor}Please install or update Go from "
5759
"https://golang.org/doc/install.${COff}")
@@ -107,7 +109,7 @@ add_custom_target(generate
107109

108110
# ----------------------------------------------------------------------------
109111
add_custom_target(test-all
110-
COMMAND ${SCRIPTS_DIR}/test-all.sh
112+
COMMAND bash -c "TB_NO_KHEDRA_TEST=true ${SCRIPTS_DIR}/test-all.sh"
111113
WORKING_DIRECTORY ${REPO_DIR}/build)
112114

113115
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)