Skip to content

Commit

Permalink
Merge pull request #64 from defi-wonderland/dev
Browse files Browse the repository at this point in the history
feat: release v1
  • Loading branch information
excaliborr authored Feb 8, 2024
2 parents 944ce51 + c2b5cc3 commit b84db64
Show file tree
Hide file tree
Showing 58 changed files with 6,133 additions and 245 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NOTE: Environment variables are only needed if you are running integration tests

E2E_BUNDLER_URL=
E2E_PAYMASTER_URL=
E2E_SEPOLIA_RPC=
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
coverage
public
build
dist

src/constants.ts
test/fixture-projects
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on: [push]

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

jobs:
build:
name: Run build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1

- name: Run build
run: yarn build
37 changes: 37 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Canary release

on: workflow_dispatch

jobs:
canary-publish:
name: Publish Packages (canary)
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Dependencies
run: yarn --frozen-lockfile --network-concurrency 1

- name: Build
run: yarn build

- name: Update version
run: yarn version --new-version "0.0.0-${GITHUB_SHA::8}" --no-git-tag-version

- name: Publish
run: npm publish --access public --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Lint

on: [push]

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

jobs:
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5

lint:
name: Run Linters
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile --network-concurrency 1

- name: Run Prettier
run: yarn prettier

- name: Run Linter
run: yarn lint
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
release:
types: [published]

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Dependencies
run: yarn --frozen-lockfile --network-concurrency 1

- name: Build
run: yarn build

- name: Publish
run: yarn publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Tests

on: [push]

jobs:
unit:
name: Run unit tests
runs-on: ubuntu-latest

steps:
- name: Check out github repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Run unit tests
run: yarn test:unit

integration:
name: Run integration tests
runs-on: ubuntu-latest

steps:
- name: Check out github repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Run integration tests
run: yarn test:integration
env:
E2E_BUNDLER_URL: ${{ secrets.E2E_BUNDLER_URL }}
E2E_PAYMASTER_URL: ${{ secrets.E2E_PAYMASTER_URL }}
E2E_PAYMASTER_TYPE: ${{ secrets.E2E_PAYMASTER_TYPE }}
E2E_SEPOLIA_RPC: ${{ secrets.E2E_SEPOLIA_RPC }}

15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ typings/

# environment variables
.env

# Solidity compilation files
out/
cache/
src/abi/**/*
!src/abi/BatchDeployAndTransferOwnership.sol

# Hardhat artifacts
test/fixture-projects/integration/artifacts/**/*

# Sponsored transactions JSON files
test/fixture-projects/integration/sponsored-transactions/

# Ignore the sponsored deployments from integration tests
sponsored-transactions/
4 changes: 4 additions & 0 deletions .husky/.commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": "ts-node/register/files",
"ignore": ["test/fixture-projects/**/*"],
"timeout": 6000
"timeout": 120000
}
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
coverage
public
build
dist
src/constants.ts
src/abi/**
test/fixture-projects/integration/artifacts/**
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"printWidth": 120,
"singleQuote": true,
"bracketSpacing": true
}
Loading

0 comments on commit b84db64

Please sign in to comment.