Skip to content

Commit

Permalink
Add ci tests
Browse files Browse the repository at this point in the history
+ fix ( NomicFoundation/hardhat#4044 )
by upgrading @nomicfoundation/hardhat-ethers to 3.0.4
+ add some docs
  • Loading branch information
david-zk committed Aug 8, 2023
1 parent 35c6b5b commit 623116e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 17 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,24 @@ jobs:
- name: "Compile the contracts and generate the TypeChain bindings"
run: "pnpm typechain"

- name: "Test the contracts and generate the coverage report"
run: "pnpm coverage"
# - name: "Test the contracts and generate the coverage report"
# run: "pnpm coverage"

- name: Login to GitHub Container Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "CI test"
run: |
pnpm fhevm:start &> fhevm.log &
tail -f fhevm.log | sed '/Starting JSON WebSocket server/ q'
pnpm fhevm:faucet
pnpm test
pnpm fhevm:stop || true
- name: "Add test summary"
run: |
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ You can edit the CI script in [.github/workflows/ci.yml](./.github/workflows/ci.

### Pre Requisites

Install [docker](https://docs.docker.com/engine/install/]

Install [pnpm](https://pnpm.io/installation)

Before being able to run any command, you need to create a `.env` file and set a BIP-39 compatible mnemonic as an
environment variable. You can follow the example in `.env.example`. If you don't already have a mnemonic, you can use
this [website](https://iancoleman.io/bip39/) to generate one.
Expand Down Expand Up @@ -213,7 +217,7 @@ pnpm clean
Deploy a new instance of the EncryptedERC20 contract via a task:

```sh
pnpm task:deployEncryptedERC20 --network zama
pnpm task:deployEncryptedERC20
```

## Tips
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.4",
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
Expand Down Expand Up @@ -80,8 +80,8 @@
"task:getEthereumAddress": "hardhat task:getEthereumAddress",
"test": "hardhat test",
"typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain",
"fhevm:start": "docker run -it -p 8545:8545 --rm --name fhevm ghcr.io/zama-ai/evmos-dev-node:v0.1.7",
"fhevm:stop": "docker stop fhevm && docker rm fhevm",
"fhevm:start": "docker run -i -p 8545:8545 --rm --name fhevm ghcr.io/zama-ai/evmos-dev-node:v0.1.7",
"fhevm:stop": "docker rm -f fhevm",
"fhevm:restart": "fhevm:stop && fhevm:stop",
"fhevm:faucet": "docker exec -i fhevm faucet $(npx hardhat task:getEthereumAddress)"
},
Expand Down
30 changes: 19 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 623116e

Please sign in to comment.