Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: testing framework #561

Merged
merged 26 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
E2E_PRIVATE_KEY_ONE=
E2E_PRIVATE_KEY_TWO=
BUNDLER_URL=https://bundler.biconomy.io/api/v2/11155111/cJPK7B3ru.dd7f7861-190d-45ic-af80-6877f74b8f44
E2E_BICO_PAYMASTER_KEY_AMOY=
E2E_BICO_PAYMASTER_KEY_BASE=
CHAIN_ID=11155111
CODECOV_TOKEN=
TESTING=false
CHAIN_ID=84532
RPC_URL=
BUNDLER_URL=
BICONOMY_SDK_DEBUG=false
RUN_PLAYGROUND=false
3 changes: 3 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ runs:
- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
shell: bash
run: bun install --frozen-lockfile
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ runs:
- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build
uses: ./.github/actions/build
15 changes: 7 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop
jobs:
coverage:
name: coverage
Expand All @@ -13,21 +14,19 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4


- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run the tests
run: bun run test:coverage
run: bun run test --coverage
env:
E2E_PRIVATE_KEY_ONE: ${{ secrets.E2E_PRIVATE_KEY_ONE }}
E2E_PRIVATE_KEY_TWO: ${{ secrets.E2E_PRIVATE_KEY_TWO }}
BUNDLER_URL: https://bundler.biconomy.io/api/v2/11155111/cJPK7B3ru.dd7f7861-190d-45ic-af80-6877f74b8f44
E2E_BICO_PAYMASTER_KEY_BASE: ${{ secrets.E2E_BICO_PAYMASTER_KEY_BASE }}
E2E_BICO_PAYMASTER_KEY_AMOY: ${{ secrets.E2E_BICO_PAYMASTER_KEY_AMOY }}
CHAIN_ID: 11155111
TESTING: true
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
CHAIN_ID: 84532
CI: true

- name: report coverage
uses: davelosert/vitest-coverage-report-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git config --global user.email "gh@runner.com"
- run: git config --global user.name "gh-runner"

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: playground
on:
workflow_dispatch:
jobs:
playground:
name: playground
permissions: write-all
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-playground
cancel-in-progress: true
steps:
- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run the playground
run: bun run test -t=playground
env:
E2E_PRIVATE_KEY_ONE: ${{ secrets.E2E_PRIVATE_KEY_ONE }}
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
CHAIN_ID: 84532
RUN_PLAYGROUND: true
CI: true
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: pr lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/size-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22

- name: Set up Bun
uses: oven-sh/setup-bun@v1
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/test-read.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/test-write.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: unit-tests
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
unit-tests:
name: unit-tests
permissions: write-all
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-unit-tests
cancel-in-progress: true
steps:
- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run the tests
run: bun run test
env:
E2E_PRIVATE_KEY_ONE: ${{ secrets.E2E_PRIVATE_KEY_ONE }}
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
CHAIN_ID: 84532
CI: true
10 changes: 5 additions & 5 deletions .size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
{
"name": "core (esm)",
"path": "./dist/_esm/index.js",
"limit": "65 kB",
"limit": "180 kB",
"import": "*",
"ignore": ["node:fs", "fs"]
},
{
"name": "core (cjs)",
"path": "./dist/_cjs/index.js",
"limit": "65 kB",
"limit": "180 kB",
"ignore": ["node:fs", "fs"]
},
{
"name": "account (tree-shaking)",
"path": "./dist/_esm/index.js",
"limit": "65 kB",
"limit": "180 kB",
"import": "{ createSmartAccountClient }",
"ignore": ["node:fs", "fs"]
},
{
"name": "bundler (tree-shaking)",
"path": "./dist/_esm/bundler/index.js",
"limit": "5 kB",
"limit": "15 kB",
"import": "{ createBundler }",
"ignore": ["node:fs", "fs"]
},
{
"name": "paymaster (tree-shaking)",
"path": "./dist/_esm/paymaster/index.js",
"limit": "5 kB",
"limit": "15 kB",
"import": "{ createPaymaster }",
"ignore": ["node:fs", "fs"]
}
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Loading