-
Notifications
You must be signed in to change notification settings - Fork 19
87 lines (78 loc) · 3.13 KB
/
account-faucet.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
name: Account Faucet
on:
schedule:
- cron: '0 22 * * *' # everyday at 06:00 AM (UTC+8)
jobs:
check-secrets:
if: github.repository == 'godwokenrises/godwoken-tests'
runs-on: ubuntu-latest
outputs:
available: ${{ steps.check.outputs.available }}
steps:
- id: check
env:
KEY1: '${{ secrets.GODWOKEN_TEST_PRIVATE_KEY }}'
KEY2: '${{ secrets.GODWOKEN_TEST_PRIVATE_KEY2 }}'
KEY3: '${{ secrets.GW_TESTNET_V1_TEST_PK }}'
if: ${{ env.KEY1 != '' && env.KEY2 != '' && env.KEY3 != '' }}
run: echo "available=true" >> $GITHUB_OUTPUT
account-faucet:
runs-on: ubuntu-latest
needs: check-secrets
if: needs.check-secrets.outputs.available
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Node Cache
uses: actions/cache@v3
id: npm-and-yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.npm
key: ${{ runner.os }}-node_modules-${{ hashFiles('/home/runner/work/**/package-lock.json', '/home/runner/work/**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Setup environment
working-directory: scripts/account-faucet
run: npm install && npm run build
- name: Claim for open test accounts
working-directory: scripts/account-faucet
env:
KEY1: 1390c30e5d5867ee7246619173b5922d3b04009cab9e9d91e14506231281a997
KEY2: 2dc6374a2238e414e51874f514b0fa871f8ce0eb1e7ecaa0aed229312ffc91b0
KEY3: dd50cac37ec6dd12539a968c1a2cbedda75bd8724f7bcad486548eaabb87fc8b
run: |
account-faucet claim-l2 -p $KEY1
account-faucet claim-l2 -p $KEY2
account-faucet claim-l2 -p $KEY3
account-faucet claim-l2 -p $KEY1 -n alphanet_v1
account-faucet claim-l2 -p $KEY2 -n alphanet_v1
account-faucet claim-l2 -p $KEY3 -n alphanet_v1
- name: Claim for private accounts
working-directory: scripts/account-faucet
env:
KEY1: ${{ secrets.GODWOKEN_TEST_PRIVATE_KEY }}
KEY2: ${{ secrets.GODWOKEN_TEST_PRIVATE_KEY2 }}
KEY3: ${{ secrets.GW_TESTNET_V1_TEST_PK }}
run: |
account-faucet claim-l2 -p $KEY1
account-faucet claim-l2 -p $KEY2
account-faucet claim-l2 -p $KEY3
account-faucet claim-l2 -p $KEY1 -n alphanet_v1
account-faucet claim-l2 -p $KEY2 -n alphanet_v1
account-faucet claim-l2 -p $KEY3 -n alphanet_v1
- name: Claim for batch-deposit/batch-withdraw derived accounts
working-directory: scripts/account-faucet
env:
KEY1: ${{ secrets.GODWOKEN_TEST_PRIVATE_KEY }}
run: |
account-faucet batch-claim-l1 \
--private-key $KEY1 \
--derived-count 10 \
--network alphanet_v1