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

Monorepo #77

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
32 changes: 9 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@
"block-scoped-var": "error",
"eqeqeq": "error",
"no-var": "error",
"prefer-const": "error",
"eol-last": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"no-trailing-spaces": "error",
"quotes": ["warn", "single", {"avoidEscape": true}],
"no-restricted-properties": [
"error",
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
}
]
"quotes": ["warn", "double", {"avoidEscape": true}],
"node/no-unpublished-import": ["error", {"devDependencies": true}],
"node/no-missing-import": "off",
"node/no-empty-function": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-missing-require": "off",
"node/shebang": "off"
},
"overrides": [
{
Expand All @@ -36,15 +30,7 @@
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/camelcase": "off",
"node/no-missing-import": "off",
"node/no-empty-function": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-missing-require": "off",
"node/shebang": "off",
"no-dupe-class-members": "off",
"require-atomic-updates": "off"
"@typescript-eslint/camelcase": "off"
}
}
],
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/publish-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: client-npm

on:
release:
types: [published]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 19.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn

- name: Formatting
run: yarn format

- name: Linting
run: yarn lint

- name: Build
run: yarn build

- name: Run tests
run: yarn test

publish:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- run: yarn
- run: yarn build
- uses: JS-DevTools/npm-publish@v3
id: publish
with:
token: ${{ secrets.NPM_TOKEN }}

- if: ${{ steps.publish.outputs.type }}
run: echo "$PCKG_ID published to $PCKG_TAG, old version was [$OLD_VER]"
env:
OLD_VER: ${{ steps.publish.outputs.old-version }}
PCKG_ID: ${{ steps.publish.outputs.id }}
PCKG_TAG: ${{ steps.publish.outputs.tag }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package to npmjs
name: core-npm

on:
release:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/publish-prover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: prover-npm

on:
release:
types: [published]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn

- name: Formatting
run: yarn format

- name: Linting
run: yarn lint

- name: Build
run: yarn build

- name: Run tests
run: yarn test

publish:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- run: yarn
- run: yarn build
- uses: JS-DevTools/npm-publish@v3
id: publish
with:
token: ${{ secrets.NPM_TOKEN }}

- if: ${{ steps.publish.outputs.type }}
run: echo "$PCKG_ID published to $PCKG_TAG, old version was [$OLD_VER]"
env:
OLD_VER: ${{ steps.publish.outputs.old-version }}
PCKG_ID: ${{ steps.publish.outputs.id }}
PCKG_TAG: ${{ steps.publish.outputs.tag }}
43 changes: 43 additions & 0 deletions .github/workflows/test-circuits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: circuits-test

on:
pull_request:
types:
- review_requested
branches:
- dev
paths:
- "packages/circuits/**"
- erhant/workspaces # TODO: remove
push:
branches:
- master
- erhant/workspaces # TODO: remove
paths:
- "packages/circuits/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install
run: pnpm --filter ./packages/circuits install

- name: Build
run: pnpm --filter ./packages/circuits run build

- name: Test
run: pnpm --filter ./packages/circuits run test
43 changes: 43 additions & 0 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: client-test

on:
pull_request:
types:
- review_requested
branches:
- dev
paths:
- "packages/client/**"
- erhant/workspaces # TODO: remove
push:
branches:
- master
- erhant/workspaces # TODO: remove
paths:
- "packages/client/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install
run: pnpm --filter ./packages/client install

- name: Build
run: pnpm --filter ./packages/client run build

- name: Test
run: pnpm --filter ./packages/client run test
49 changes: 49 additions & 0 deletions .github/workflows/test-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: core-test

on:
pull_request:
types:
- review_requested
branches:
- dev
paths:
- "packages/client/**"
- erhant/workspaces # TODO: remove
push:
branches:
- master
- erhant/workspaces # TODO: remove
paths:
- "packages/client/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install
run: pnpm --filter ./packages/core install

- name: Build
run: pnpm --filter ./packages/core run build

- name: Start Redis
uses: supercharge/redis-github-action@1.5.0
with:
redis-version: 7
redis-port: 6379

- name: Test
run: pnpm --filter ./packages/core run test
42 changes: 42 additions & 0 deletions .github/workflows/test-prover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: prover-test

on:
pull_request:
types:
- review_requested
branches:
- dev
paths:
- "packages/prover/**"
- erhant/workspaces # TODO: remove
push:
branches:
- master
paths:
- "packages/prover/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install
run: pnpm --filter ./packages/prover install

- name: Build
run: pnpm --filter ./packages/prover run build

- name: Test
run: pnpm --filter ./packages/prover run test
Loading
Loading