Skip to content

Commit

Permalink
chore: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Aug 23, 2024
1 parent 6013394 commit dcf4468
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4


- name: Build
uses: ./.github/actions/build
6 changes: 4 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +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
run: bun run test --coverage
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

- name: report coverage
uses: davelosert/vitest-coverage-report-action@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ 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
9 changes: 6 additions & 3 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}-playground
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/checkout@v4

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

- name: Run the account tests
run: RUN_PLAYGROUND=true bun run test:ci -t=Playground
- name: Run the playground
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
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
2 changes: 1 addition & 1 deletion .github/workflows/size-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

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

- uses: actions/setup-node@v4
with:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}-unit-tests
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/checkout@v4


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

- name: Run the account tests
run: bun run test:ci
- 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
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@
"dev": "bun link && concurrently \"bun run esm:watch\" \"bun run cjs:watch\" \"bun run esm:watch:aliases\" \"bun run cjs:watch:aliases\"",
"build": "bun run clean && bun run build:cjs && bun run build:esm && bun run build:types",
"clean": "rimraf ./dist/_esm ./dist/_cjs ./dist/_types ./dist/tsconfig",
"test": "vitest dev -c ./tests/vitest.config.ts",
"test": "vitest -c ./tests/vitest.config.ts",
"test:watch": "bun run test dev",
"playground": "RUN_PLAYGROUND=true bun run test -t=Playground",
"playground:watch": "RUN_PLAYGROUND=true bun run test -t=Playground --watch",
"test:watch": "bun run test --watch",
"test:coverage": "CI=true vitest -c ./tests/vitest.config.ts --coverage",
"test:ci": "CI=true vitest -c ./tests/vitest.config.ts",
"size": "size-limit",
"docs": "typedoc --tsconfig ./tsconfig/tsconfig.esm.json",
"docs:deploy": "bun run docs && gh-pages -d docs",
Expand Down
14 changes: 2 additions & 12 deletions tests/instances/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ import {
killNetwork,
toTestClient
} from "../test.utils"
import type {
MasterClient,
NetworkConfig,
NetworkConfigWithBundler
} from "../test.utils"
import { type TestFileNetworkType, aaTest, toNetwork } from "../testSetup"
import type { MasterClient, NetworkConfig } from "../test.utils"
import { type TestFileNetworkType, toNetwork } from "../testSetup"

const NETWORK_TYPE: TestFileNetworkType = "LOCAL"

Expand Down Expand Up @@ -106,10 +102,4 @@ describe("account", () => {
"0x89028E0fD7Af7F864878e0209118DF6A9229A9Ce" // Recipient smart account
])
})

test("should", async () => {
const counterAddress = network.deployment.counterAddress
const byteCode = await testClient.getBytecode({ address: counterAddress })
expect(byteCode).toBeTruthy()
})
})
2 changes: 1 addition & 1 deletion tests/testSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type NetworkConfigWithTestClients = NetworkConfigWithBundler & {
fundedTestClients: FundedTestClients
}

export const aaTest = test.extend<{
export const scopedTest = test.extend<{
config: NetworkConfigWithTestClients
}>({
// biome-ignore lint/correctness/noEmptyPattern: Needed in vitest :/
Expand Down
6 changes: 3 additions & 3 deletions tests/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig } from "vitest/config"
export default defineConfig({
test: {
coverage: {
all: true,
all: false,
provider: "v8",
reporter: process.env.CI
? ["json-summary", "json"]
Expand All @@ -25,8 +25,8 @@ export default defineConfig({
statements: 80
}
},
include: ["tests/**/*.test.ts"],
globalSetup: [join(__dirname, "./globalSetup.ts")],
include: [join(__dirname, "./tests/**/*.test.ts")],
globalSetup: [join(__dirname, "./tests/globalSetup.ts")],
sequence: {
concurrent: false
},
Expand Down

0 comments on commit dcf4468

Please sign in to comment.