Skip to content

Commit

Permalink
workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed May 24, 2024
1 parent c436c39 commit a8503fc
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 688 deletions.
47 changes: 17 additions & 30 deletions .github/workflows/test-circuits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,37 @@ name: circuits-test
on:
pull_request:
types:
- opened
- review_requested
branches:
- dev
paths:
- "packages/circuits/**"
push:
branches:
- master
- dev
- erhant/workspaces # TODO: remove
paths:
- "packages/circuits/**"

jobs:
style:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v1
- uses: pnpm/action-setup@v4
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)"
version: 8

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
- name: Use Node.js 20
uses: actions/setup-node@v4
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
node-version: 20
cache: "pnpm"

- name: Build
run: yarn build
- name: Install
run: pnpm install --frozen-lockfile --filter=./packages/circuits

- name: Run tests
run: yarn test
run: pnpm test --filter=./packages/circuits
41 changes: 23 additions & 18 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
name: client-test

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

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v1
- uses: pnpm/action-setup@v4
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)"
version: 8

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 20
cache: "pnpm"

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

- name: Install dependencies
run: yarn
- name: Build
run: pnpm build --filter=./packages/client

- name: Run tests
run: yarn test
run: pnpm test --filter=./packages/client
13 changes: 0 additions & 13 deletions .github/workflows/test-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ jobs:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

Expand Down
47 changes: 17 additions & 30 deletions .github/workflows/test-prover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,37 @@ name: prover-test
on:
pull_request:
types:
- opened
- review_requested
branches:
- dev
paths:
- "packages/prover/**"
- erhant/workspaces # TODO: remove
push:
branches:
- master
- dev
paths:
- "packages/prover/**"

jobs:
style:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v1
- uses: pnpm/action-setup@v4
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)"
version: 8

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
- name: Use Node.js 20
uses: actions/setup-node@v4
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
node-version: 20
cache: "pnpm"

- name: Build
run: yarn build
- name: Install
run: pnpm install --frozen-lockfile --filter=./packages/prover

- name: Run tests
run: yarn test
run: pnpm test --filter=./packages/prover
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"gts": "^5.3.0",
"jest": "^29.7.0",
"pkgroll": "^2.1.1",
"prettier": "2.8.3",
Expand Down
14 changes: 2 additions & 12 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,8 @@
"homepage": "https://github.com/firstbatchxyz/hollowdb-client#readme",
"license": "MIT",
"scripts": {
"prebuild": "pnpm clean:lib && pnpm lint",
"build": "pkgroll",
"test": "jest",
"clean": "gts clean",
"clean:lib": "rm -rf ./lib",
"lint": "gts lint",
"format": "prettier --write './src/**/*.ts'",
"prepublishOnly": "pnpm lint",
"preversion": "pnpm lint && pnpm build",
"version": "pnpm format && git add -A src",
"postversion": "git push && git push --tags",
"yalc:publish": "pnpm build && yalc publish --push"
"build": "rm -rf ./lib && pkgroll",
"test": "jest"
},
"type": "module",
"types": "./dist/index.d.cts",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"warp-contracts": "^1.4.2"
},
"optionalDependencies": {
"hollowdb-prover": "workspace:^1.4",
"hollowdb-prover": "workspace:^",
"ioredis": "^5.3.2",
"warp-contracts-lmdb": "^1.1.10",
"warp-contracts-plugin-ethers": "^1.0.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/null.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ValueType = {val: string} | null;
describe("null value tests with proofs", () => {
const warpHook = setupWarp();
const protocol = "groth16";
let prover: Prover;
let prover: Prover<typeof protocol>;
let owner: SDK<ValueType>;

const {KEY, KEY_PREIMAGE, VALUE, NEXT_VALUE} = createValues();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/proofs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ValueType = {val: string};
describe("proofs mode", () => {
describe.each(["groth16", "plonk"] as const)("protocol: %s", (protocol) => {
const warpHook = setupWarp();
let prover: Prover;
let prover: Prover<typeof protocol>;
let owner: SDK<ValueType>;
let alice: SDK<ValueType>;

Expand Down
7 changes: 2 additions & 5 deletions packages/prover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
"homepage": "https://github.com/firstbatchxyz/hollowdb-prover#readme",
"license": "MIT",
"scripts": {
"prebuild": "pnpm clean:lib && pnpm lint",
"build": "pkgroll",
"test": "jest",
"clean": "gts clean",
"clean:lib": "rm -rf ./lib"
"build": "rm -rf ./lib && pkgroll",
"test": "jest"
},
"type": "module",
"types": "./dist/index.d.cts",
Expand Down
Loading

0 comments on commit a8503fc

Please sign in to comment.