-
Notifications
You must be signed in to change notification settings - Fork 24
70 lines (66 loc) · 2.78 KB
/
hardhat-simple-project.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
# This workflow simulates the steps described in `docs/hardhat-simple-project.md`.
# Code authors should ensure the workflow follows this tutorial document.
name: Simple Test
on:
push:
branches: [develop, master, ci, 'v1*', compatibility-changes]
# Publish semver tags as releases.
tags: ["v*.*.*"]
pull_request:
jobs:
hardhat-simple-project:
runs-on: ubuntu-latest
steps:
- run: echo "Part 1. Deploy Local Network of Godwoken"
- name: Checkout Godwoken-Kicker
uses: actions/checkout@v3
- run: git rev-parse HEAD
- run: ./kicker init
- name: Kicker start
run: |
# Temporary workaround unreliable web3 health check
(echo " == kicker start attempt: 1 == " && ./kicker start) || \
(echo " == kicker start attempt: 2 == " && ./kicker stop && ./kicker start) || \
(echo " == kicker start failed == " && docker-compose --file docker/docker-compose.yml logs --tail 6 && exit 1)
docker-compose --file docker/docker-compose.yml logs --tail 6
- run: ./kicker info
- run: ./kicker ps
- run: ./kicker ps web3
- run: ./kicker logs
- run: ./kicker logs web3
- run: ./kicker -- top
- run: ./kicker -- exec -i ckb ls -l
- run: ./kicker -- --help
- run: ./kicker deposit 0xCD1d13450cFA630728D0390C99957C6948BF7d19 10000
- run: echo "Part 2. Deploy A Simple Contract Using Hardhat"
- run: |
git clone -b hardhat@2.9.9 --depth=1 https://github.com/NomicFoundation/hardhat
mv hardhat/packages/hardhat-core/sample-projects/basic .
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node-
- name: Install hardhat
working-directory: basic
run: |
npm install --save-dev hardhat @nomiclabs/hardhat-waffle chai
npx hardhat --version
- name: Adapt hardhat.config.js to our local network of Godwoken
run: |
sed -i 's#solidity:# networks: { gw_devnet_v1: { url: `http://127.0.0.1:8024/instant-finality-hack`, accounts: [`0x9d5bc55413c14cf4ce360a6051eacdc0e580100a0d3f7f2f48f63623f6b05361`], } }, solidity:#g' hardhat.config.js
cat hardhat.config.js
working-directory: basic
- run: npx hardhat accounts --network gw_devnet_v1
working-directory: basic
- run: npx hardhat compile
working-directory: basic
- run: npx hardhat test --network gw_devnet_v1
working-directory: basic
- run: npx hardhat run --network gw_devnet_v1 scripts/sample-script.js
working-directory: basic
- run: echo "Part3. Clean Up"
- run: ./kicker stop
- run: sudo ./kicker clean
- run: ./kicker ps