Skip to content

Commit

Permalink
CI: fix Simple Test -> install Hardhat locally (#224)
Browse files Browse the repository at this point in the history
fix Error HH12: Trying to use a non-local installation of Hardhat, which is not supported.
For more info go to https://hardhat.org/HH12
  • Loading branch information
Flouse authored Apr 14, 2022
1 parent 2a1e009 commit 976f03e
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/hardhat-simple-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,33 @@ jobs:
- run: ./kicker deposit 0xCD1d13450cFA630728D0390C99957C6948BF7d19 1000

- run: echo "Part 2. Deploy A Simple Contract Using Hardhat"
- run: git clone --depth=1 https://github.com/NomicFoundation/hardhat
- run: npm install --save-dev hardhat @nomiclabs/hardhat-waffle
working-directory: hardhat/packages/hardhat-core/sample-projects/basic/
- run: |
git clone --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`, accounts: [`0x9d5bc55413c14cf4ce360a6051eacdc0e580100a0d3f7f2f48f63623f6b05361`], } }, solidity:#g' hardhat.config.js
cat hardhat.config.js
working-directory: hardhat/packages/hardhat-core/sample-projects/basic/
working-directory: basic
- run: npx hardhat accounts --network gw_devnet_v1
working-directory: hardhat/packages/hardhat-core/sample-projects/basic/
working-directory: basic
- run: npx hardhat compile
working-directory: hardhat/packages/hardhat-core/sample-projects/basic/
working-directory: basic
- run: npx hardhat test --network gw_devnet_v1
working-directory: hardhat/packages/hardhat-core/sample-projects/basic/
working-directory: basic
- run: npx hardhat run --network gw_devnet_v1 scripts/sample-script.js
working-directory: hardhat/packages/hardhat-core/sample-projects/basic/
working-directory: basic

- run: echo "Part3. Clean Up"
- run: ./kicker stop
Expand Down

0 comments on commit 976f03e

Please sign in to comment.