Skip to content

Commit

Permalink
test(evm): ethers.js tests for evm (#1896)
Browse files Browse the repository at this point in the history
* test(evm): eth api integration test suite

* test(evm): more integration tests for eth api

* feat: implemented basic evm tx methods

* chore: lint

* chore: lint

* chore: lint

* chore: extracted evm chain_id to appconst

* fix: tests

* fix: tests

* fix: lint

* chore: cleanup

* refactor: merge

* fix: eth chain ID test

* fix(eth): chain ID

* linter fix

* test(evm): integration tests for tx and smart contract

* chore(evm): disabled json rpc by default

* test(evm): ethers.js tests for evm

* test(evm): github workflow

* fix: gh actions evm tests npm instead of yarn

* fix: evm gh tests

* fix: evm gh tests

* fix: evm gh tests

* chore: cleanup

* chore: renamed evm job

* refactor: merge conflict rever

* refactor(e2e): consistent path

* chore: cleanup unused

* wip!: try removing chain ID hacks

* wip!: try removing chain ID hacks

* chore: linter

---------

Co-authored-by: Unique-Divine <[email protected]>
  • Loading branch information
onikonychev and Unique-Divine authored May 27, 2024
1 parent f3ec804 commit 7e22538
Show file tree
Hide file tree
Showing 12 changed files with 4,405 additions and 46 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/e2e-evm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: EVM e2e tests

on:
pull_request:
paths:
[
"**.go",
"**.proto",
"go.mod",
"go.sum",
"**go.mod",
"**go.sum",
"contrib/docker/*",
"**.js",
"**.json",
]

# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}

jobs:
ethers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache: true

# Use GitHub actions output paramters to get go paths. For more info, see
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
- name: "Set output variables for go cache"
id: go-cache-paths
run: |
echo "go-build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: "Go build cache"
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build-cache }}
key: go-build-cache-${{ hashFiles('**/go.sum') }}

- name: "Go mod cache"
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod-cache }}
key: go-mod-cache-${{ hashFiles('**/go.sum') }}

- name: "Install just"
# casey/just: https://just.systems/man/en/chapter_6.html
# taiki-e/install-action: https://github.com/taiki-e/install-action
uses: taiki-e/install-action@just

- name: "Build the nibid binary"
run: |
just install
- name: Setup NodeJS with npm caching
uses: actions/setup-node@v4
with:
node-version: 18

- name: NPM Install
run: npm install
working-directory: "e2e/evm"

- name: "Launch localnet"
run: |
just localnet --no-build &
sleep 6
- name: Run tests
run: npm test
working-directory: "e2e/evm"
env:
JSON_RPC_ENDPOINT: http://127.0.0.1:8545
MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
Loading

0 comments on commit 7e22538

Please sign in to comment.