Skip to content

Commit cf09399

Browse files
authored
chore: wip changes to integrate with sdk (#872)
* chore: wip changes to integrate with sdk Signed-off-by: Tomás Migone <[email protected]> * fix: clean up Signed-off-by: Tomás Migone <[email protected]> * chore: remove test lib helper, replace with sdk Signed-off-by: Tomás Migone <[email protected]> * chore: use sdk for test libs Signed-off-by: Tomás Migone <[email protected]> * feat: tests and e2e tests passing Signed-off-by: Tomás Migone <[email protected]> * chore: wip decouple and delete cli Signed-off-by: Tomás Migone <[email protected]> * feat(sdk): complete sdk integrationx Signed-off-by: Tomás Migone <[email protected]> * test: fix chai matchers Signed-off-by: Tomás Migone <[email protected]> * 5.3.1 * chore: bump sdk, remove gre ci tests Signed-off-by: Tomás Migone <[email protected]> * test: fix coverage tes Signed-off-by: Tomás Migone <[email protected]> * chore: bump sdk version Signed-off-by: Tomás Migone <[email protected]> * 5.3.2 * fix: support e2e tests Signed-off-by: Tomás Migone <[email protected]> * chore: rename cli folder Signed-off-by: Tomás Migone <[email protected]> * test: disable interval mining in hardhat network Signed-off-by: Tomás Migone <[email protected]> * chore: delete commented out import Signed-off-by: Tomás Migone <[email protected]> * chore: convert repo into a yarn workspaces monorepo and add sdk package (#888) * chore: convert repo into a yarn workspaces monorepo Signed-off-by: Tomás Migone <[email protected]> * chore: add sdk Signed-off-by: Tomás Migone <[email protected]> * chore: fix cross reference dependencies and add readme Signed-off-by: Tomás Migone <[email protected]> * ci: fix setup action Signed-off-by: Tomás Migone <[email protected]> * ci: use yarn v4 Signed-off-by: Tomás Migone <[email protected]> * ci: add missing property to setup action Signed-off-by: Tomás Migone <[email protected]> * ci: add more missing properties Signed-off-by: Tomás Migone <[email protected]> * ci: refactor corepack enable Signed-off-by: Tomás Migone <[email protected]> * ci: run for all branches and prs Signed-off-by: Tomás Migone <[email protected]> * ci: fix coverage file path Signed-off-by: Tomás Migone <[email protected]> * ci: add workflow dispatch trigger Signed-off-by: Tomás Migone <[email protected]> * chore: trigger ci Signed-off-by: Tomás Migone <[email protected]> * chore: update README Signed-off-by: Tomás Migone <[email protected]> * test: fix failing tests Signed-off-by: Tomás Migone <[email protected]> * chore: minor nits Signed-off-by: Tomás Migone <[email protected]> * chore: fixup prettier config Signed-off-by: Tomás Migone <[email protected]> * chore: roll back prettier-plugin-solidity to old version to avoid reformatting Signed-off-by: Tomás Migone <[email protected]> * chore: bump packages versions and add publish ci action Signed-off-by: Tomás Migone <[email protected]> * docs: update readme with versioning and publishing instructions Signed-off-by: Tomás Migone <[email protected]> --------- Signed-off-by: Tomás Migone <[email protected]> * fix: change localhost for 127.0.0.1 to avoid node v17+ issues Signed-off-by: Tomás Migone <[email protected]> --------- Signed-off-by: Tomás Migone <[email protected]>
1 parent a667f7a commit cf09399

File tree

485 files changed

+27881
-18498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

485 files changed

+27881
-18498
lines changed

.github/actions/setup/action.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Setup
2+
3+
runs:
4+
using: composite
5+
6+
steps:
7+
- name: Enable corepack for modern yarn
8+
shell: bash
9+
run: corepack enable
10+
- name: Install Node.js
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: 18
14+
cache: 'yarn'
15+
- name: Install dependencies
16+
shell: bash
17+
run: yarn --immutable
18+
- name: Build
19+
shell: bash
20+
run: yarn build

.github/workflows/build.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build
2+
3+
env:
4+
CI: true
5+
6+
on:
7+
push:
8+
branches: "*"
9+
pull_request:
10+
branches: "*"
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Set up environment
20+
uses: ./.github/actions/setup

.github/workflows/ci.yml

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
name: Run CI tests
1+
name: CI
2+
3+
env:
4+
CI: true
25

36
on:
47
push:
5-
branches: [main]
6-
pull_request: {}
8+
branches: "*"
9+
paths:
10+
- packages/contracts/**
11+
pull_request:
12+
branches: "*"
13+
paths:
14+
- packages/contracts/**
15+
workflow_dispatch:
716

817
jobs:
9-
build:
18+
test-ci:
1019
runs-on: ubuntu-latest
11-
12-
strategy:
13-
matrix:
14-
node-version: [16.x]
15-
1620
steps:
17-
- uses: actions/checkout@v3
18-
- name: Use Node.js ${{ matrix.node-version }}
19-
uses: actions/setup-node@v3
20-
with:
21-
node-version: ${{ matrix.node-version }}
22-
- name: Install packages
23-
run: yarn install --non-interactive --frozen-lockfile
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Set up environment
24+
uses: ./.github/actions/setup
2425
- name: Run tests
2526
run: yarn test:coverage
2627
- name: Upload coverage report
2728
uses: codecov/codecov-action@v3
2829
with:
2930
token: ${{ secrets.CODECOV_TOKEN }}
30-
files: ./coverage.json
31+
files: ./packages/contracts/coverage.json
3132
flags: unittests
3233
name: graphprotocol-contracts
3334
fail_ci_if_error: true

.github/workflows/e2e.yml

+26-23
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
1-
name: Run E2E tests
1+
name: E2E
2+
3+
env:
4+
CI: true
25

36
on:
47
push:
5-
branches: [main]
8+
branches: "*"
9+
paths:
10+
- packages/contracts/contracts/**
11+
- packages/contracts/config/**
12+
- packages/contracts/e2e/**
13+
- packages/contracts/tasks/**
14+
- packages/contracts/scripts/**
15+
- packages/contracts/hardhat.config.ts
16+
pull_request:
17+
branches: "*"
618
paths:
7-
- contracts/**
8-
- config/**
9-
- e2e/**
10-
- cli/**
11-
- tasks/**
12-
- scripts/**
13-
- hardhat.config.ts
14-
pull_request: {}
19+
- packages/contracts/contracts/**
20+
- packages/contracts/config/**
21+
- packages/contracts/e2e/**
22+
- packages/contracts/tasks/**
23+
- packages/contracts/scripts/**
24+
- packages/contracts/hardhat.config.ts
25+
workflow_dispatch:
1526

1627
jobs:
17-
build:
28+
test-e2e:
1829
runs-on: ubuntu-latest
19-
20-
strategy:
21-
matrix:
22-
node-version: [16.x]
23-
2430
steps:
25-
- uses: actions/checkout@v3
26-
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
28-
with:
29-
node-version: ${{ matrix.node-version }}
30-
- name: Install packages
31-
run: yarn install --non-interactive --frozen-lockfile
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Set up environment
34+
uses: ./.github/actions/setup
3235
- name: Run e2e tests
3336
run: |
3437
git clone https://github.com/edgeandnode/nitro

.github/workflows/gre.yml

-29
This file was deleted.

.github/workflows/npmpublish.yml

-33
This file was deleted.

.github/workflows/publish.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish package to NPM
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
package:
7+
description: 'Package to publish'
8+
required: true
9+
type: choice
10+
options:
11+
- contracts
12+
- sdk
13+
tag:
14+
description: 'Tag to publish'
15+
required: true
16+
type: string
17+
default: latest
18+
19+
jobs:
20+
publish:
21+
name: Publish package
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Set up environment
27+
uses: ./.github/actions/setup
28+
- name: Publish 🚀
29+
shell: bash
30+
run: |
31+
pushd packages/${{ inputs.package }}
32+
yarn npm publish --tag ${{ inputs.tag }} --access public
33+
env:
34+
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/verifydeployed.yml

+8-12
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ jobs:
2323
name: Compile contracts
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
27-
- uses: actions/setup-node@v3
28-
with:
29-
node-version: '16'
30-
cache: 'yarn'
31-
- run: yarn install --non-interactive --frozen-lockfile
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
- name: Set up environment
29+
uses: ./.github/actions/setup
3230

3331
- name: Compile contracts
3432
run: yarn build
@@ -46,12 +44,10 @@ jobs:
4644
runs-on: ubuntu-latest
4745
needs: build
4846
steps:
49-
- uses: actions/checkout@v3
50-
- uses: actions/setup-node@v3
51-
with:
52-
node-version: '16'
53-
cache: 'yarn'
54-
- run: yarn install --non-interactive --frozen-lockfile
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
- name: Set up environment
50+
uses: ./.github/actions/setup
5551
- name: Get build artifacts
5652
uses: actions/download-artifact@v3
5753
with:

.gitignore

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
# Logs
2+
yarn-debug.log*
3+
yarn-error.log*
4+
5+
# Dependency directories
16
node_modules/
27

3-
# Ignore build stuff
4-
cache/
5-
build/
6-
dist/
8+
# Yarn
9+
.yarn/*
10+
!.yarn/patches
11+
!.yarn/releases
12+
!.yarn/plugins
13+
!.yarn/sdks
14+
!.yarn/versions
715

8-
# Hardhat cache
16+
# Hardhat artifacts
17+
artifacts/
18+
cache/
919
cached/
1020

21+
# Build artifacts
22+
dist/
23+
build/
24+
1125
# Ignore solc bin output
1226
bin/
1327

@@ -28,4 +42,4 @@ tx-*.log
2842
addresses-fork.json
2943

3044
# Keys
31-
.keystore
45+
.keystore

.husky/pre-commit

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
33

4+
# contracts
5+
cd packages/contracts
46
npx --no-install lint-staged

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

0 commit comments

Comments
 (0)