-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
121 lines (109 loc) · 3.98 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: "Hedera Solo"
description: "Run a Hedera Solo network"
inputs:
installMirrorNode:
description: "Defines if a mirror node should be installed"
required: true
default: false
type: boolean
hederaVersion:
description: "Version of Hedera to use. Defaults to Mainnet version."
required: false
default: "v0.52.2"
mirrorNodePort:
description: "Port for Mirror Node"
required: false
default: "8080"
installRelay:
description: 'Install JSON-RPC-Relay'
required: false
default: false
type: boolean
outputs:
accountId:
description: "Hedera account id for a new account"
value: ${{ steps.create-account.outputs.accountId }}
publicKey:
description: "Hedera public key for the new account"
value: ${{ steps.create-account.outputs.publicKey }}
privateKey:
description: "Hedera private key for the new account"
value: ${{ steps.create-account.outputs.privateKey }}
runs:
using: "composite"
steps:
- name: print inputs
shell: bash
run: |
echo "installMirrorNode: ${{ inputs.installMirrorNode }}"
echo "is installMirrorNode: ${{ inputs.installMirrorNode == 'true' }}"
- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: temurin
java-version: 21
- name: Setup Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 22
- name: Install WGet CLI
shell: bash
run: sudo apt-get update && sudo apt-get install -y wget
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup Kind
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
version: v0.21.0
kubectl_version: v1.28.6
cluster_name: solo-e2e
wait: 120s
- name: Install Solo
shell: bash
run: npm install -g @hashgraph/solo@0.28.1
- name: Deploy Solo Test Network
shell: bash
run: |
solo init -i node0 -t ${{ inputs.hederaVersion }} -n solo-test --key-format pem --profile local
solo cluster setup
solo node keys --tls-keys --gossip-keys
solo network deploy
solo node setup
solo node start
kubectl port-forward svc/haproxy-node0-svc -n solo-test 50211:50211 &
- name: Deploy MirrorNode
if: ${{ inputs.installMirrorNode == 'true' }} # see https://github.com/actions/runner/issues/2238
shell: bash
run: |
solo mirror-node deploy
kubectl port-forward svc/fullstack-deployment-hedera-explorer -n solo-test ${{ inputs.mirrorNodePort }}:80 &
- name: Deploy JSON-RPC-Relay
if: ${{ inputs.installRelay == 'true' }}
shell: bash
run: |
echo "Installing JSON-RPC-Relay..."
solo relay deploy
echo "JSON-RPC-Relay installed successfully"
- name: Create account
id: create-account
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
run: |
JSON=$(solo account create | python3 $GITHUB_ACTION_PATH/extractAccountAsJson.py)
export HEDERA_ACCOUNT_ID=$(echo $JSON | jq -r '.accountId')
export HEDERA_ACCOUNT_PUBLIC_KEY=$(echo $JSON | jq -r '.publicKey')
export HEDERA_ACCOUNT_PRIVATE_KEY=$(kubectl get secret account-key-$HEDERA_ACCOUNT_ID -n solo-test -o jsonpath='{.data.privateKey}' | base64 -d | xargs)
solo account update --account-id $HEDERA_ACCOUNT_ID --hbar-amount 10000000
echo "accountId=$HEDERA_ACCOUNT_ID"
echo "publicKey=$HEDERA_ACCOUNT_PUBLIC_KEY"
echo "privateKey=$HEDERA_ACCOUNT_PRIVATE_KEY"
echo "accountId=$HEDERA_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "publicKey=$HEDERA_ACCOUNT_PUBLIC_KEY" >> $GITHUB_OUTPUT
echo "privateKey=$HEDERA_ACCOUNT_PRIVATE_KEY" >> $GITHUB_OUTPUT
# Ref: https://haya14busa.github.io/github-action-brandings/
branding:
icon: "share-2"
color: "black"