Skip to content

Commit 75dc58d

Browse files
author
andrii.pavliv
committed
feat: updated go libs. Fixed snyk and versioning issues
Signed-off-by: andrii.pavliv <andrii.pavliv@securekey>
1 parent 41f20c3 commit 75dc58d

24 files changed

Lines changed: 544 additions & 504 deletions

File tree

.github/workflows/build.yml

Lines changed: 118 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
name: "wallet-sdk ci"
88

99
env:
10-
GO_VERSION: '1.23.4'
10+
GO_VERSION: '1.25.1'
1111

1212
on:
1313
push:
@@ -97,8 +97,8 @@ jobs:
9797
- name: Build docker images for test server
9898
run: |
9999
docker build -f ./images/mocks/loginconsent/Dockerfile --no-cache -t wallet-sdk/mock-login-consent:latest \
100-
--build-arg GO_VER=1.23 \
101-
--build-arg ALPINE_VER=3.20 .
100+
--build-arg GO_VER=1.25 \
101+
--build-arg ALPINE_VER=3.22 .
102102
- name: Save docker image as tar
103103
run: |
104104
docker save --output /tmp/mock-login-consent.tar wallet-sdk/mock-login-consent
@@ -120,8 +120,8 @@ jobs:
120120
- name: Build docker images for test server
121121
run: |
122122
docker build -f ./images/mocks/webhook/Dockerfile --no-cache -t wallet-sdk/sample-webhook:latest \
123-
--build-arg GO_VER=1.23 \
124-
--build-arg ALPINE_VER=3.20 .
123+
--build-arg GO_VER=1.25 \
124+
--build-arg ALPINE_VER=3.22 .
125125
- name: Save docker image as tar
126126
run: |
127127
docker save --output /tmp/mock-sample-webhook.tar wallet-sdk/sample-webhook
@@ -143,8 +143,8 @@ jobs:
143143
- name: Build docker images for test server
144144
run: |
145145
docker build -f ./images/mocks/trustregistry/Dockerfile --no-cache -t wallet-sdk/mock-trust-registry:latest \
146-
--build-arg GO_VER=1.23 \
147-
--build-arg ALPINE_VER=3.20 .
146+
--build-arg GO_VER=1.25 \
147+
--build-arg ALPINE_VER=3.22 .
148148
- name: Save docker image as tar
149149
run: |
150150
docker save --output /tmp/mock-trust-registry.tar wallet-sdk/mock-trust-registry
@@ -166,8 +166,8 @@ jobs:
166166
- name: Build docker images for test server
167167
run: |
168168
docker build -f ./images/mocks/attestation/Dockerfile --no-cache -t wallet-sdk/mock-attestation:latest \
169-
--build-arg GO_VER=1.23 \
170-
--build-arg ALPINE_VER=3.20 .
169+
--build-arg GO_VER=1.25 \
170+
--build-arg ALPINE_VER=3.22 .
171171
- name: Save docker image as tar
172172
run: |
173173
docker save --output /tmp/mock-attestation.tar wallet-sdk/mock-attestation
@@ -178,7 +178,7 @@ jobs:
178178
path: /tmp/mock-attestation.tar
179179

180180
iOSFlutterIntegrationTest:
181-
runs-on: macos-13
181+
runs-on: macos-15
182182
needs: [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer, BuilMockAttestationServer, BuildMockSampleWebhookServer ]
183183
timeout-minutes: 60
184184
steps:
@@ -210,7 +210,7 @@ jobs:
210210
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
211211
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
212212
- name: Install and start docker
213-
uses: douglascamata/setup-docker-macos-action@v1-alpha
213+
uses: douglascamata/setup-docker-macos-action@v1.0.1
214214
with:
215215
upgrade-qemu: false
216216
lima: v1.0.4
@@ -265,80 +265,138 @@ jobs:
265265
docker ps -a
266266
267267
AndroidFlutterIntegrationTest:
268-
runs-on: macos-13
268+
runs-on: macos-15
269269
needs: [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer, BuilMockAttestationServer, BuildMockSampleWebhookServer ]
270270
timeout-minutes: 60
271+
272+
# NEW: ensure every step talks to the Colima daemon
273+
env:
274+
DOCKER_HOST: unix:///Users/runner/.colima/default/docker.sock
275+
DOCKER_BUILDKIT: "1"
276+
271277
steps:
272-
- name: checkout
278+
# Fetch tags so your version script doesn't print "No names found"
279+
- name: Checkout
273280
uses: actions/checkout@v4
281+
with:
282+
fetch-depth: 0
283+
fetch-tags: true
284+
274285
- name: Set up Go
275286
uses: actions/setup-go@v5
276287
with:
277288
go-version: ${{ env.GO_VERSION }}
289+
290+
- name: Configure Go env (proxy & sumdb)
291+
run: |
292+
go env -w GOSUMDB=sum.golang.org
293+
go env -w GOPROXY="https://proxy.golang.org,direct"
294+
278295
- name: Generate and copy Android Binding
279296
run: |
280-
echo $PATH
281-
echo ${{ github.workspace }}
282-
echo ${GOPATH}
283-
echo ${GOROOT}
284-
export PATH=$PATH:$GOPATH/bin
285-
echo $PATH
297+
echo "$PATH"
298+
echo "${{ github.workspace }}"
299+
echo "${GOPATH}"
300+
echo "${GOROOT}"
301+
mkdir -p "$GOPATH/bin"
302+
export PATH="$PATH:$GOPATH/bin"
303+
echo "$PATH"
286304
go install golang.org/x/mobile/cmd/gomobile@latest
287305
gomobile init
288306
NEW_VERSION=testVer GIT_REV=testRev BUILD_TIME=testTime make generate-android-bindings copy-android-bindings
289307
env:
290308
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
291-
GOPATH: /Users/runner/work/wallet-sdk/go
309+
GOPATH: ${{ github.workspace }}/.gopath
310+
292311
- name: Setup hosts
293312
run: |
294-
echo '127.0.0.1 file-server.trustbloc.local' | sudo tee -a /etc/hosts
295-
echo '127.0.0.1 did-resolver.trustbloc.local' | sudo tee -a /etc/hosts
296-
echo '127.0.0.1 vc-rest-echo.trustbloc.local' | sudo tee -a /etc/hosts
297-
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
298-
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
299-
- name: Install and start docker
300-
uses: douglascamata/setup-docker-macos-action@v1-alpha
301-
with:
302-
upgrade-qemu: false
303-
lima: v1.0.4
304-
colima: v0.8.1
313+
echo '127.0.0.1 file-server.trustbloc.local' | sudo tee -a /etc/hosts
314+
echo '127.0.0.1 did-resolver.trustbloc.local' | sudo tee -a /etc/hosts
315+
echo '127.0.0.1 vc-rest-echo.trustbloc.local' | sudo tee -a /etc/hosts
316+
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
317+
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
318+
319+
# Install Docker CLI and start Colima
320+
- name: Install Docker (Colima) on macOS
321+
env:
322+
HOMEBREW_NO_INSTALL_CLEANUP: "1"
323+
HOMEBREW_NO_ENV_HINTS: "1"
324+
HOMEBREW_NO_ANALYTICS: "1"
325+
NONINTERACTIVE: "1"
326+
run: |
327+
set -euxo pipefail
328+
brew update
329+
brew install colima docker docker-buildx
330+
colima start --cpu 4 --memory 8 --disk 20
331+
# Select context (persists in ~/.docker)
332+
docker context use colima
333+
# Wait until the engine is REALLY ready
334+
for i in {1..60}; do
335+
if docker info >/dev/null 2>&1; then
336+
break
337+
fi
338+
sleep 2
339+
done
340+
docker version
341+
docker info
342+
343+
# NEW: double-check Docker before image loads (handles rare races/crashes)
344+
- name: Ensure Docker is up (Colima)
345+
run: |
346+
colima status || colima start --cpu 4 --memory 8 --disk 20
347+
for i in {1..60}; do
348+
if docker info >/dev/null 2>&1; then
349+
break
350+
fi
351+
sleep 2
352+
done
353+
docker context inspect
354+
echo "Docker is ready."
355+
305356
- name: Download artifacts (Docker images) from previous workflows
306357
uses: actions/download-artifact@v4
358+
307359
- name: Load mock-login-consent server
308-
run: |
309-
docker load --input mock-login-consent/mock-login-consent.tar
360+
run: docker load --input mock-login-consent/mock-login-consent.tar
361+
310362
- name: Load mock test registry server
311-
run: |
312-
docker load --input mock-trust-registry/mock-trust-registry.tar
363+
run: docker load --input mock-trust-registry/mock-trust-registry.tar
364+
313365
- name: Load mock attestation server
314-
run: |
315-
docker load --input mock-attestation/mock-attestation.tar
366+
run: docker load --input mock-attestation/mock-attestation.tar
367+
316368
- name: Load mock-sample-webhook server
317-
run: |
318-
docker load --input mock-sample-webhook/mock-sample-webhook.tar
369+
run: docker load --input mock-sample-webhook/mock-sample-webhook.tar
370+
319371
- name: Generate test cli and keys
320-
run: |
321-
make build-integration-cli generate-test-keys
372+
run: make build-integration-cli generate-test-keys
373+
322374
- name: Setup env for integration test
323-
run: |
324-
make start-integration-env-flutter
375+
run: make start-integration-env-flutter
376+
325377
- name: Gradle cache
326378
uses: gradle/gradle-build-action@v3
327-
- uses: actions/setup-java@v3
379+
380+
- name: Set up Java
381+
uses: actions/setup-java@v3
328382
with:
329383
distribution: 'zulu'
330384
java-version: '21'
385+
331386
- name: Setup Flutter SDK
332387
uses: flutter-actions/setup-flutter@v2
333388
with:
334389
channel: stable
335390
version: 3.27.4
391+
336392
- name: Install flutter app dependencies
337393
run: make install-flutter-dependencies
394+
338395
- name: Build APK in Debug mode
339396
run: |
340397
cd demo/app
341398
flutter build apk --debug
399+
342400
- name: Run flutter and android tests on Emulator
343401
uses: reactivecircus/android-emulator-runner@v2
344402
with:
@@ -348,8 +406,24 @@ jobs:
348406
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
349407
disable-animations: true
350408
script: adb reverse tcp:8075 tcp:8075 && adb reverse tcp:8072 tcp:8072 && adb reverse tcp:9229 tcp:9229 && adb reverse tcp:8097 tcp:8097 && make integration-test-flutter integration-test-android
409+
351410
- name: Docker container status output
352411
if: always()
353412
run: |
354413
docker images
355414
docker ps -a
415+
416+
# Helpful logs if anything Docker/Colima fails
417+
- name: Colima diagnostics
418+
if: failure()
419+
run: |
420+
set -x
421+
colima status || true
422+
colima list || true
423+
colima logs --last 200 || true
424+
docker context ls || true
425+
docker info || true
426+
427+
- name: Stop Colima
428+
if: always()
429+
run: colima stop || true

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
name: "wallet-sdk release"
88

99
env:
10-
GO_VERSION: '1.23'
10+
GO_VERSION: '1.25'
1111

1212
on:
1313
push:
@@ -32,7 +32,7 @@ jobs:
3232
cd ..
3333
git clone https://go.googlesource.com/go goroot
3434
cd goroot
35-
git checkout go1.23.4
35+
git checkout go1.25.1
3636
cp ../wallet-sdk/cmd/wallet-sdk-gomobile/gopatches/* ./
3737
git revert 3560cf0afb3c29300a6c88ccd98256949ca7a6f6
3838
cd src && ./make.bash
@@ -98,7 +98,7 @@ jobs:
9898
cd ..
9999
git clone https://go.googlesource.com/go goroot
100100
cd goroot
101-
git checkout go1.23.4
101+
git checkout go1.25.1
102102
cp ../wallet-sdk/cmd/wallet-sdk-gomobile/gopatches/* ./
103103
git revert 3560cf0afb3c29300a6c88ccd98256949ca7a6f6
104104
cd src && ./make.bash

.golangci.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#
2-
# Copyright Avast Software. All Rights Reserved.
3-
#
4-
# SPDX-License-Identifier: Apache-2.0
5-
#
1+
version: 2
62

73
run:
84
concurrency: 4
@@ -13,9 +9,11 @@ run:
139

1410
output:
1511
formats:
16-
- format: colored-line-number
17-
print-issued-lines: true
18-
print-linter-name: true
12+
text:
13+
path: stdout
14+
print-issued-lines: true
15+
print-linter-name: true
16+
colors: true
1917

2018
linters-settings:
2119
errcheck:
@@ -77,13 +75,11 @@ linters:
7775
- cyclop # TODO consider replacing gocyclo with cyclop
7876
- wrapcheck # TODO enable
7977
- forbidigo # TODO enable
80-
- gci # giving spurious errors for imports of syscall/js
8178
- exhaustruct # Results in unneeded struct member declarations
8279
- ireturn # Required by aries-framework-go, a library we use
8380
- tagliatelle # JSON tags using camel-case required by the specs we implement
8481
- varnamelen # This linter prevents us from using "i" as an index variable or "vc" for a variable name for a Verifiable Credential, both of which are very common in our code
8582
- depguard # TODO consider enabling in the future
86-
- exportloopref
8783
- revive
8884
- perfsprint
8985
- thelper

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ else
1212
PATH:=$(PATH);$(subst /,\\,$(GOBIN_PATH))
1313
endif
1414

15-
ALPINE_VER ?= 3.20
16-
GO_ALPINE_VER ?= 3.20
17-
GO_VER ?= 1.23
15+
ALPINE_VER ?= 3.22
16+
GO_ALPINE_VER ?= 3.22
17+
GO_VER ?= 1.25
1818

1919
NEW_VERSION ?= $(shell git describe --tags --always `git rev-list --tags --max-count=1`)-SNAPSHOT-$(shell git rev-parse --short=7 HEAD)
2020
GIT_REV ?= $(shell git rev-parse HEAD)

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
apply plugin: 'maven-publish'
88

9+
910
publishing {
1011
publications {
1112
bar(MavenPublication) {

cmd/wallet-sdk-gomobile/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This package contains the `gomobile`-compatible version of the SDK. It acts as a
44

55
## Prerequisites
66

7-
* [Go 1.23](https://go.dev/doc/install) or newer
7+
* [Go 1.25](https://go.dev/doc/install) or newer
88
* The gomobile tools:
99
```
1010
go install golang.org/x/mobile/cmd/gomobile@latest

0 commit comments

Comments
 (0)