Skip to content

Commit 6312437

Browse files
authored
update deps and readme (#1027)
* update deps to latest and update readme * add back vitest * fix
1 parent 81996d4 commit 6312437

File tree

10 files changed

+258
-1266
lines changed

10 files changed

+258
-1266
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,30 @@
1-
name: Build Docker Images
2-
1+
name: Build Packages
32
on:
43
push:
5-
tags:
6-
- '*'
7-
workflow_dispatch:
4+
paths-ignore:
5+
- '**/README.md'
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
810

911
jobs:
10-
build-eth-rpc-adapter:
12+
build:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- name: checkout
14-
uses: actions/checkout@v3
15-
with:
16-
submodules: 'recursive'
17-
- name: Set up Docker Buildx
18-
uses: docker/setup-buildx-action@v2
16+
uses: actions/checkout@v4
1917

20-
- name: Login to Docker Hub
21-
uses: docker/login-action@v2
18+
- name: setup node
19+
uses: actions/setup-node@v4
2220
with:
23-
username: ${{ secrets.DOCKERHUB_USERNAME }}
24-
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
node-version: 20
2522

26-
- name: Docker meta
27-
id: meta
28-
uses: docker/metadata-action@v4
29-
with:
30-
images: acala/eth-rpc-adapter
31-
tags: |
32-
type=semver,pattern={{version}}
33-
type=raw,value={{sha}}
34-
type=ref,event=branch
23+
- name: setup yarn
24+
run: npm install -g yarn
3525

36-
- name: Build and push
37-
uses: docker/build-push-action@v4
38-
with:
39-
context: .
40-
file: packages/eth-rpc-adapter/Dockerfile
41-
platforms: linux/amd64,linux/arm64
42-
push: true
43-
tags: ${{ steps.meta.outputs.tags }}
44-
labels: ${{ steps.meta.outputs.labels }}
26+
- name: install deps
27+
run: yarn install --immutable
4528

46-
build-evm-subql:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- name: checkout
50-
uses: actions/checkout@v3
51-
with:
52-
submodules: 'recursive'
53-
- name: Set up Docker Buildx
54-
uses: docker/setup-buildx-action@v2
55-
56-
- name: Login to Docker Hub
57-
uses: docker/login-action@v2
58-
with:
59-
username: ${{ secrets.DOCKERHUB_USERNAME }}
60-
password: ${{ secrets.DOCKERHUB_TOKEN }}
61-
62-
- name: Docker meta
63-
id: meta
64-
uses: docker/metadata-action@v4
65-
with:
66-
images: acala/evm-subql
67-
tags: |
68-
type=semver,pattern={{version}}
69-
type=raw,value={{sha}}
70-
type=ref,event=branch
71-
72-
- name: Build and push
73-
uses: docker/build-push-action@v4
74-
with:
75-
context: .
76-
file: packages/evm-subql/Dockerfile
77-
platforms: linux/amd64,linux/arm64
78-
push: true
79-
tags: ${{ steps.meta.outputs.tags }}
80-
labels: ${{ steps.meta.outputs.labels }}
29+
- name: build
30+
run: yarn build

.github/workflows/docker.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build Docker Images
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-eth-rpc-adapter:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v3
15+
with:
16+
submodules: 'recursive'
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v2
19+
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v2
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
25+
26+
- name: Docker meta
27+
id: meta
28+
uses: docker/metadata-action@v4
29+
with:
30+
images: acala/eth-rpc-adapter
31+
tags: |
32+
type=semver,pattern={{version}}
33+
type=raw,value={{sha}}
34+
type=ref,event=branch
35+
36+
- name: Build and push
37+
uses: docker/build-push-action@v4
38+
with:
39+
context: .
40+
file: packages/eth-rpc-adapter/Dockerfile
41+
platforms: linux/amd64,linux/arm64
42+
push: true
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}
45+
46+
build-evm-subql:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: checkout
50+
uses: actions/checkout@v3
51+
with:
52+
submodules: 'recursive'
53+
- name: Set up Docker Buildx
54+
uses: docker/setup-buildx-action@v2
55+
56+
- name: Login to Docker Hub
57+
uses: docker/login-action@v2
58+
with:
59+
username: ${{ secrets.DOCKERHUB_USERNAME }}
60+
password: ${{ secrets.DOCKERHUB_TOKEN }}
61+
62+
- name: Docker meta
63+
id: meta
64+
uses: docker/metadata-action@v4
65+
with:
66+
images: acala/evm-subql
67+
tags: |
68+
type=semver,pattern={{version}}
69+
type=raw,value={{sha}}
70+
type=ref,event=branch
71+
72+
- name: Build and push
73+
uses: docker/build-push-action@v4
74+
with:
75+
context: .
76+
file: packages/evm-subql/Dockerfile
77+
platforms: linux/amd64,linux/arm64
78+
push: true
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Acala EVM+ SDKs
2+
[![codecov](https://codecov.io/github/AcalaNetwork/bodhi.js/graph/badge.svg?token=knumpsfImD)](https://codecov.io/github/AcalaNetwork/bodhi.js)
3+
24
These are some tools and SDKs related to Acala EVM+. It also contains some examples about how to interact with EVM+ with these tools.
35

6+
47
Packages:
58
- [bodhi.js](./packages/bodhi)
69
- [eth-providers](./packages/eth-providers)
710
- [eth-rpc-adapter](./packages/eth-rpc-adapter)
811
- [evm-subql](./packages/evm-subql)
9-
- [examples](./examples)
1012

1113
## Getting Started
12-
- initialize submodules (only need to do once after git clone)
13-
```
14-
git submodule update --init --recursive
15-
```
16-
1714
- install all dependencies
1815
```
1916
yarn
@@ -24,53 +21,20 @@ yarn
2421
yarn build
2522
```
2623

27-
- run tests
28-
```
29-
yarn test
30-
```
31-
32-
## e2e-tests
33-
```
34-
# build the bodhi-runner image
35-
docker build . -t bodhi-runner -f docker/bodhi-runner.Dockerfile
36-
yarn e2e:eth-providers
37-
yarn e2e:eth-rpc-adapter
38-
yarn e2e:waffle
39-
yarn e2e:hardhat
40-
yarn e2e:truffle
41-
```
42-
4324
## Run Tests
44-
### with docker
4525
- clean up
4626
```
4727
docker compose down -v
4828
```
4929

50-
- run tests
30+
- start a chopsticks acala fork as the test node
5131
```
52-
## build the bodhi-runner image
53-
docker build . -t bodhi-runner -f docker/bodhi-runner.Dockerfile
54-
55-
## run any test
56-
docker compose up --abort-on-container-exit --exit-code-from=xxx --build -- xxx
57-
58-
where xxx ∈ {
59-
eth-providers-test,
60-
eth-rpc-adapter-test,
61-
waffle-examples-test,
62-
hardhat-tutorials-test,
63-
truffle-tutorials-test,
64-
}
65-
66-
## run all tests (not recommended since log will be too messy)
6732
docker compose up
6833
```
6934

70-
we can grep container logs by
35+
- run tests
7136
```
72-
docker compose logs --tail=0 --follow # all logs
73-
docker logs -f <container_id> # logs for specific container
37+
yarn workspace @acala-network/<pkg-name> run test:coverage
7438
```
7539

7640
## Docker Images

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
"@swc/core": "^1.3.56",
4141
"@swc/helpers": "^0.5.1",
4242
"@types/eslint": "^8",
43-
"@types/node": "^20.1.0",
44-
"@typescript-eslint/eslint-plugin": "^5.58.0",
45-
"@typescript-eslint/parser": "^5.58.0",
43+
"@types/node": "^22.7.0",
44+
"@typescript-eslint/eslint-plugin": "^8.7.0",
45+
"@typescript-eslint/parser": "^8.7.0",
46+
"@vitest/coverage-istanbul": "^2.1.1",
4647
"eslint": "^8.40.0",
4748
"eslint-import-resolver-typescript": "^3.5.5",
4849
"eslint-plugin-import": "^2.27.5",
@@ -52,9 +53,10 @@
5253
"nyc": "^17.1.0",
5354
"pm2": "^5.4.2",
5455
"ts-node": "^10.9.1",
56+
"ts-node-dev": "^2.0.0",
5557
"tsconfig-paths": "^4.2.0",
56-
"typescript": "^5.0.4",
57-
"vite-tsconfig-paths": "^4.2.0",
58+
"typescript": "^5.6.0",
59+
"vite-tsconfig-paths": "^4.0.0",
5860
"vitest": "^2.1.1"
5961
},
6062
"lint-staged": {

packages/bodhi/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
"bn.js": "~5.2.0",
2020
"ethers": "~5.7.0"
2121
},
22-
"devDependencies": {
23-
"typescript": "~4.6.3",
24-
"vitest": "^2.1.1"
25-
},
2622
"files": [
2723
"lib"
2824
],
@@ -38,5 +34,8 @@
3834
"default": "./lib/*.js"
3935
},
4036
"./package.json": "./package.json"
37+
},
38+
"devDependencies": {
39+
"vitest": "^2.1.1"
4140
}
4241
}

packages/eth-providers/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
"@polkadot/api": "^12.4.2",
2929
"@types/bn.js": "^5.1.5",
3030
"@types/lru-cache": "~7.6.1",
31-
"@vitest/coverage-istanbul": "^2.1.1",
3231
"dotenv": "~10.0.0",
33-
"jsdom": "^22.0.0",
3432
"vitest": "^2.1.1"
3533
},
3634
"files": [

packages/eth-rpc-adapter/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"dd-trace": "~4.16.0",
3030
"ethers": "~5.7.0",
3131
"pino": "~7.0.0-rc.3",
32-
"ts-node-dev": "^2.0.0",
3332
"ws": "~8.2.3",
3433
"yargs": "16.2.0"
3534
},
@@ -46,9 +45,7 @@
4645
"nyc": "^17.1.0",
4746
"pino-pretty": "~7.0.1",
4847
"pm2": "^5.4.2",
49-
"ts-node": "~10.7.0",
50-
"typescript": "~4.6.3",
51-
"vitest": "0.34.2"
48+
"vitest": "^2.1.1"
5249
},
5350
"files": [
5451
"lib",

packages/eth-transactions/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
"test": "vitest",
1010
"test:coverage": "vitest --run --coverage"
1111
},
12-
"devDependencies": {
13-
"typescript": "~4.6.3",
14-
"vitest": "^2.1.1"
15-
},
1612
"peerDependencies": {
1713
"@polkadot/util-crypto": "^13.0.2"
1814
},
@@ -34,5 +30,8 @@
3430
"default": "./lib/*.js"
3531
},
3632
"./package.json": "./package.json"
33+
},
34+
"devDependencies": {
35+
"vitest": "^2.1.1"
3736
}
3837
}

packages/eth-transactions/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "lib",
5-
"rootDir": "src"
5+
"rootDir": "src",
66
},
77
"include": ["src/**/*"],
88
"exclude": ["node_modules", "lib", "src/__tests__"]

0 commit comments

Comments
 (0)