Skip to content

feat: HIP-1195 Hiero Hooks and an application to allowances #2642

feat: HIP-1195 Hiero Hooks and an application to allowances

feat: HIP-1195 Hiero Hooks and an application to allowances #2642

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@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
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@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.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@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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.65.0
mirrorNodeVersion: v0.136.1
- 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@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.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@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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.65.0
mirrorNodeVersion: v0.136.1
- 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@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
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@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: "1.24"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- 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