Skip to content

Commit

Permalink
add back vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Sep 26, 2024
1 parent 494876c commit 4f9ff51
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 77 deletions.
86 changes: 18 additions & 68 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,30 @@
name: Build Docker Images

name: Build Packages
on:
push:
tags:
- '*'
workflow_dispatch:
paths-ignore:
- '**/README.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-eth-rpc-adapter:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v2
- name: setup node
uses: actions/setup-node@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
node-version: 20

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: acala/eth-rpc-adapter
tags: |
type=semver,pattern={{version}}
type=raw,value={{sha}}
type=ref,event=branch
- name: setup yarn
run: npm install -g yarn

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: packages/eth-rpc-adapter/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: install deps
run: yarn install --immutable

build-evm-subql:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: acala/evm-subql
tags: |
type=semver,pattern={{version}}
type=raw,value={{sha}}
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: packages/evm-subql/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: build
run: yarn build
80 changes: 80 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build Docker Images

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
build-eth-rpc-adapter:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: acala/eth-rpc-adapter
tags: |
type=semver,pattern={{version}}
type=raw,value={{sha}}
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: packages/eth-rpc-adapter/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-evm-subql:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: acala/evm-subql
tags: |
type=semver,pattern={{version}}
type=raw,value={{sha}}
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: packages/evm-subql/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 3 additions & 0 deletions packages/bodhi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"default": "./lib/*.js"
},
"./package.json": "./package.json"
},
"devDependencies": {
"vitest": "^2.1.1"
}
}
3 changes: 2 additions & 1 deletion packages/eth-providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"@polkadot/api": "^12.4.2",
"@types/bn.js": "^5.1.5",
"@types/lru-cache": "~7.6.1",
"dotenv": "~10.0.0"
"dotenv": "~10.0.0",
"vitest": "^2.1.1"
},
"files": [
"lib"
Expand Down
3 changes: 2 additions & 1 deletion packages/eth-rpc-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"@vercel/ncc": "^0.36.1",
"nyc": "^17.1.0",
"pino-pretty": "~7.0.1",
"pm2": "^5.4.2"
"pm2": "^5.4.2",
"vitest": "^2.1.1"
},
"files": [
"lib",
Expand Down
7 changes: 3 additions & 4 deletions packages/eth-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
"test": "vitest",
"test:coverage": "vitest --run --coverage"
},
"devDependencies": {
"typescript": "^5.0.4",
"vitest": "^2.1.1"
},
"peerDependencies": {
"@polkadot/util-crypto": "^13.0.2"
},
Expand All @@ -34,5 +30,8 @@
"default": "./lib/*.js"
},
"./package.json": "./package.json"
},
"devDependencies": {
"vitest": "^2.1.1"
}
}
8 changes: 5 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ __metadata:
"@types/bn.js": ~5.1.0
bn.js: ~5.2.0
ethers: ~5.7.0
vitest: ^2.1.1
peerDependencies:
"@polkadot/api": ^12.4.2
languageName: unknown
Expand Down Expand Up @@ -64,6 +65,7 @@ __metadata:
graphql: ~16.0.1
graphql-request: ~3.6.1
lru-cache: ~7.8.2
vitest: ^2.1.1
peerDependencies:
"@acala-network/api": 6.1.3
"@polkadot/api": ^12.4.2
Expand Down Expand Up @@ -95,6 +97,7 @@ __metadata:
pino: ~7.0.0-rc.3
pino-pretty: ~7.0.1
pm2: ^5.4.2
vitest: ^2.1.1
ws: ~8.2.3
yargs: 16.2.0
peerDependencies:
Expand All @@ -109,7 +112,6 @@ __metadata:
resolution: "@acala-network/eth-transactions@workspace:packages/eth-transactions"
dependencies:
ethers: ~5.7.0
typescript: ^5.0.4
vitest: ^2.1.1
peerDependencies:
"@polkadot/util-crypto": ^13.0.2
Expand Down Expand Up @@ -15214,7 +15216,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:>=5.2.2, typescript@npm:^5.0.4, typescript@npm:^5.6.0":
"typescript@npm:>=5.2.2, typescript@npm:^5.6.0":
version: 5.6.2
resolution: "typescript@npm:5.6.2"
bin:
Expand All @@ -15234,7 +15236,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@>=5.2.2#~builtin<compat/typescript>, typescript@patch:typescript@^5.0.4#~builtin<compat/typescript>, typescript@patch:typescript@^5.6.0#~builtin<compat/typescript>":
"typescript@patch:typescript@>=5.2.2#~builtin<compat/typescript>, typescript@patch:typescript@^5.6.0#~builtin<compat/typescript>":
version: 5.6.2
resolution: "typescript@patch:typescript@npm%3A5.6.2#~builtin<compat/typescript>::version=5.6.2&hash=f3b441"
bin:
Expand Down

0 comments on commit 4f9ff51

Please sign in to comment.