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

refactor: move to lerna monorepo #452

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 0 additions & 15 deletions .github/actions/build-hardhat/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/install-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- uses: ./.github/actions/install

- name: Restore forge compilation cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: |
cache
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:

steps:
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
- uses: actions/checkout@v4
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install
Expand Down
50 changes: 9 additions & 41 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,38 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install

- name: Build contracts via IR & check sizes
# don't use compilation cache
# skip import files, because we don't care if contracts are too big
run: yarn build:forge --force --sizes --skip Import
run: yarn build --force --sizes --skip Import


build-no-ir:
name: Compilation (without IR)
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache

- name: Build contracts without IR
run: yarn build:forge
run: yarn build
env:
FOUNDRY_PROFILE: test

- name: Save forge compilation cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: |
cache
Expand All @@ -89,23 +73,15 @@ jobs:
max-test-rejects: 65536

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache

- name: Run local tests on chain ${{ matrix.chain }} in ${{ matrix.type }} mode
run: yarn test:forge:local
run: yarn test:local
env:
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
FOUNDRY_FUZZ_MAX_TEST_REJECTS: ${{ matrix.max-test-rejects }}
Expand All @@ -131,23 +107,15 @@ jobs:
max-test-rejects: 65536

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache

- name: Run fork tests on chain ${{ matrix.chain }} in ${{ matrix.type }} mode
run: yarn test:forge:fork --chain ${{ matrix.chain }}
run: yarn test:fork --chain ${{ matrix.chain }}
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
FOUNDRY_FUZZ_RUNS: ${{ matrix.fuzz-runs }}
Expand Down
41 changes: 24 additions & 17 deletions .github/workflows/hardhat.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
name: Hardhat
name: Hardhat Test Suite

on:
push:
branches:
- main
pull_request:
workflow_call:
secrets:
ALCHEMY_KEY:
required: true

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

jobs:
test:
name: Test
hardhat:
runs-on: ubuntu-latest

strategy:
matrix:
package:
- @morpho-org/bundlers-sdk-ethers

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4

- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive
node-version: 20
cache: yarn

- name: Build contracts & package with hardhat
uses: ./.github/actions/build-hardhat
- run: yarn --immutable

- uses: actions/cache@v4
with:
path: |
packages/${{ matrix.package }}/cache/
packages/${{ matrix.package }}/artifacts/
key: ${{ github.base_ref || github.ref_name }}-${{ matrix.package }}-hardhat

- name: Run hardhat tests
run: yarn test:hardhat
- run: yarn workspace ${{ matrix.package }} test
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
28 changes: 0 additions & 28 deletions .github/workflows/npm-release.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: NPM Release

on:
workflow_dispatch:

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

jobs:
lerna:
runs-on: ubuntu-latest

environment:
name: npm
url: https://www.npmjs.com/package/@morpho-org/morpho-blue-bundlers

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@users.noreply.github.com'

- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- run: yarn --immutable

- run: yarn lerna version --no-private --conventional-commits --create-release github --generate-release-notes --y

- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
yarn run publish --y
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ node_modules/
/cache_hardhat
/artifacts

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

*.log
3 changes: 0 additions & 3 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

git submodule update --init --recursive
yarn
3 changes: 0 additions & 3 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

git submodule update --init --recursive
yarn
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
3 changes: 0 additions & 3 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit "${1}"
Loading
Loading