Skip to content

Commit

Permalink
Merge branch 'next' of https://github.com/morpho-org/sdks into feat/s…
Browse files Browse the repository at this point in the history
…ky-additional-liquidity
  • Loading branch information
0x666c6f committed Oct 18, 2024
2 parents f0d403f + 6b0ce8f commit 0531679
Show file tree
Hide file tree
Showing 131 changed files with 21,205 additions and 20,660 deletions.
46 changes: 8 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
name: Build packages
name: Build

on:
push:
branches:
- main
pull_request:

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

jobs:
build:
strategy:
fail-fast: false
matrix:
package:
- test
- test-viem
- test-ethers
- test-wagmi

- morpho-ts
- morpho-test

- blue-api-sdk
- blue-sdk
- blue-sdk-ethers
- blue-sdk-viem
- blue-sdk-wagmi

- simulation-sdk
- simulation-sdk-wagmi
- bundler-sdk

- liquidation-sdk-viem

packages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache: pnpm

- run: yarn install --immutable
- run: yarn postinstall # for some reason, postinstall script does not get executed automatically
- run: pnpm install

- run: yarn workspace @morpho-org/${{ matrix.package }} build
- run: pnpm -r --parallel --no-reporter-hide-prefix build
19 changes: 8 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
name: Lint code
name: Lint

on:
push:

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

jobs:
lint:
biome:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache: pnpm

- run: yarn install --immutable
- run: yarn postinstall # for some reason, postinstall script does not get executed automatically
- run: pnpm install

- run: yarn lint
- run: pnpm lint
57 changes: 0 additions & 57 deletions .github/workflows/npm-release.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish

on:
workflow_call:
secrets:
NPM_TOKEN:
required: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# Fetch all history so that we can determine the version to release.
fetch-depth: 0

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- run: pnpm install

# First, set version of each package to the latest tagged so they are referenced correclty in dependencies.
- run: pnpm -r --parallel --no-reporter-hide-prefix -c exec 'node ../../scripts/release/version.js'

- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- run: pnpm -r --parallel --no-reporter-hide-prefix -c exec 'node ../../scripts/release/publish.js'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

on:
push:
branches:
- '**'
tags-ignore:
- '**'

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

jobs:
lint:
uses: ./.github/workflows/lint.yml

build:
uses: ./.github/workflows/build.yml

test:
uses: ./.github/workflows/test.yml
secrets: inherit

publish:
# needs:
# - lint
# - build
# - test

uses: ./.github/workflows/publish.yml
secrets: inherit
19 changes: 10 additions & 9 deletions .github/workflows/vitest.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test packages
name: Test

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

jobs:
vitest:
Expand All @@ -13,16 +13,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache: pnpm

- uses: foundry-rs/foundry-toolchain@v1

- run: yarn install --immutable
- run: yarn postinstall # for some reason, postinstall script does not get executed automatically
- run: pnpm install

- run: yarn test --coverage
- run: pnpm run test --coverage
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ local_*

# Local Netlify folder
.netlify

!.vscode
7 changes: 1 addition & 6 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
STAGED_TS_FILES=$(git diff --staged --name-only --diff-filter=d | grep '\.tsx\?$' | xargs)

if [ -n "$STAGED_TS_FILES" ]; then
yarn lint --write $STAGED_TS_FILES
git add $STAGED_TS_FILES
fi
pnpm exec lint-staged
1 change: 1 addition & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec commitlint --edit
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
link-workspace-packages=deep
prefer-workspace-packages=true

ignore-workspace-cycles=true
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"arcanis.vscode-zipfs"
"esbenp.prettier-vscode",
"biomejs.biome"
]
}
13 changes: 2 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.defaultFormatter": "biomejs.biome",
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"quickfix.biome": "always",
"source.organizeImports.biome": "always"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Loading

0 comments on commit 0531679

Please sign in to comment.