Skip to content

chore: Update to Go 1.24 #2528

chore: Update to Go 1.24

chore: Update to Go 1.24 #2528

Workflow file for this run

name: PR Checks
defaults:
run:
shell: bash
permissions:
contents: read
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: hiero-client-sdk-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.24
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Tidy SDK Modules
run: go mod tidy
working-directory: ./
- name: Lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
skip-cache: true
args: --timeout=5m
- name: Build SDK and Examples
run: go build -v ./...
test:
name: Unit and Integration Tests
if: success()
runs-on: hiero-client-sdk-linux-medium
needs:
- build
strategy:
matrix:
test-type: [unit, e2e]
env:
HEDERA_NETWORK: "localhost"
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.24
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare Hiero Solo
if: success() && matrix.test-type == 'e2e'
id: solo
uses: hiero-ledger/hiero-solo-action@a39acf8cfbaa2feb195a86530d0ab643a45aa541 # v0.10.0
with:
installMirrorNode: true
hieroVersion: v0.63.7
- name: Set Operator Account
if: success() && matrix.test-type == 'e2e'
run: |
echo "OPERATOR_KEY=${{ steps.solo.outputs.ed25519PrivateKey }}" >> $GITHUB_ENV
echo "OPERATOR_ID=${{ steps.solo.outputs.ed25519AccountId }}" >> $GITHUB_ENV
- name: Tests Unit
if: success() && matrix.test-type == 'unit'
run: go test ./sdk -tags="unit" -timeout 9999s -v -coverprofile=unit.out -covermode=atomic -race
- name: Tests Integration
if: success() && matrix.test-type == 'e2e'
run: go test ./sdk -tags="e2e" -timeout 9999s -v -coverprofile=e2e.out -covermode=atomic -race
- name: Upload unit test coverage to Codecov
if: success() && matrix.test-type == 'unit'
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit.out
- name: Upload e2e test coverage to Codecov
if: success() && matrix.test-type == 'e2e'
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./e2e.out
run-examples:
name: Run Examples
if: success()
runs-on: hiero-client-sdk-linux-medium
needs:
- build
env:
HEDERA_NETWORK: "localhost"
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.24
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@v3.17.0
- name: Prepare Hiero Solo
id: solo
uses: hiero-ledger/hiero-solo-action@a39acf8cfbaa2feb195a86530d0ab643a45aa541 # v0.10.0
with:
installMirrorNode: true
hieroVersion: v0.63.7
- name: Set Operator Account
run: |
echo "OPERATOR_KEY=${{ steps.solo.outputs.ed25519PrivateKey }}" >> $GITHUB_ENV
echo "OPERATOR_ID=${{ steps.solo.outputs.ed25519AccountId }}" >> $GITHUB_ENV
- name: Run Examples
if: success()
run: task run-examples
build-test-tck:
name: Build and Test TCK
runs-on: hiero-client-sdk-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.24
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Tidy TCK Modules
run: go mod tidy
working-directory: ./tck
- name: Build TCK
run: go build -v ./...
working-directory: ./tck
- name: Lint TCK
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
skip-cache: true
args: --timeout=5m
working-directory: ./tck
- name: Test TCK
run: go test ./...
working-directory: ./tck