Skip to content

Commit

Permalink
Sdk core v0.5.0 (#965)
Browse files Browse the repository at this point in the history
* Resolver Set + Workflow Modifications (#951)
* add SetEvent to getAllEvents query (#953)
* Subgraph 1.4.4 Release Bump | SDK-Core 0.4.5 Release Bump (#955)
* Initialize logic contracts on deployment (using "castrate") (#841)
* [SDK-core] Compile AJV validations (#954)
* SDK-Core Build Fix (#963)
* [EXAMPLES] Fix sdk initializations (#946)
* bump sdk-core version to 0.5.0 (#964)

Co-authored-by: elvijsTDL <77115130+elvijsTDL@users.noreply.github.com>
Co-authored-by: David A. Divas <62566465+Daldiv@users.noreply.github.com>
Co-authored-by: Miao ZhiCheng <miao@superfluid.finance>
Co-authored-by: Kaspar Kallas <kaspar@superfluid.finance>
Co-authored-by: Joshua Trujillo <Jtriley15@gmail.com>
Co-authored-by: Didi <git@d10r.net>
Co-authored-by: saflamini <43142465+saflamini@users.noreply.github.com>
  • Loading branch information
8 people authored Jul 19, 2022
1 parent a6a5262 commit 736485a
Show file tree
Hide file tree
Showing 153 changed files with 17,051 additions and 14,298 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/call.check-query-schema-against-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
node-version: 16.x

- name: "Install contract dependencies"
run: yarn install
run: yarn install --frozen-lockfile
working-directory: ${{ env.contracts-working-directory }}

- name: "Build contracts"
Expand All @@ -35,35 +35,10 @@ jobs:

- name: "Install packages and start hardhat node"
run: |
yarn install
yarn install --frozen-lockfile
./tasks/startHardhatNode.sh start
working-directory: ${{ env.sdk-core-working-directory }}

# duplicated in call.test-subgraph-on-previous-sdk-core-versions, call.setup-deploy-and-test-local-subgraph
- name: "Checkout graph node repo and set up local graph node"
uses: actions/checkout@v3
with:
repository: graphprotocol/graph-node
path: graph-node
token: ${{ secrets.GITHUB_TOKEN }}

- name: "Run setup because linux and docker-compose"
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
chmod +x setup.sh
./setup.sh
working-directory: ./graph-node/docker

- name: "Docker compose"
run: docker-compose up &
working-directory: ./graph-node/docker

- name: "Prepare and Deploy Local Subgraph"
run: yarn testenv:start
working-directory: ./packages/subgraph
#

- name: Run schema check
run: |
./tasks/setupTestEnvironment.sh
Expand All @@ -72,3 +47,6 @@ jobs:
env:
SUBGRAPH_RELEASE_TAG: ${{ inputs.subgraph-release }}

- name: "Stop Hardhat node"
run: ./tasks/startHardhatNode.sh stop
working-directory: ${{ env.sdk-core-working-directory }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:

- name: "Install packages and start hardhat node"
run: |
yarn install
yarn install --frozen-lockfile
./tasks/startHardhatNode.sh start
working-directory: ./packages/sdk-core

# duplicated in call.test-subgraph-on-previous-sdk-core-versions, call.check-query-schema-against-subgraph
# duplicated in call.test-subgraph-on-previous-sdk-core-versions
- name: "Checkout graph node repo and set up local graph node"
uses: actions/checkout@v3
with:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/call.test-hardhat-deployer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Reusable Workflow | Test Hardhat-Deployer

on:
workflow_call:

jobs:
test-hardhat-deployer:
name: Test Hardhat-Deployer

runs-on: ubuntu-latest

env:
contracts-working-directory: ./packages/ethereum-contracts
hardhat-working-directory: ./packages/hardhat-deployer

steps:
- uses: actions/checkout@v3

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

- name: "Install contract dependencies"
run: yarn install --frozen-lockfile
working-directory: ${{ env.contracts-working-directory }}

- name: "Build contracts"
run: yarn build:contracts
working-directory: ${{ env.contracts-working-directory }}

- name: "Install dependencies"
run: yarn
working-directory: ${{ env.hardhat-working-directory }}

- name: "Run test suite"
run: yarn test
working-directory: ${{ env.hardhat-working-directory }}
2 changes: 1 addition & 1 deletion .github/workflows/call.test-sdk-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
node-version: 16.x

- name: "Install contract dependencies"
run: yarn install
run: yarn install --frozen-lockfile
working-directory: ${{ env.contracts-working-directory }}

- name: "Build contracts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
subgraph-release:
required: true
type: string
subgraph-endpoint:
required: true
type: string

jobs:
build-and-test-live-subgraph-previous-releases:
Expand All @@ -15,7 +18,7 @@ jobs:

strategy:
matrix:
version: [v0.3.2, v0.4.0, v0.4.1, v0.4.2, latest]
version: [v0.3.2, v0.4.0, v0.4.1, v0.4.2, v0.4.3, latest]

env:
contracts-working-directory: ./packages/ethereum-contracts
Expand All @@ -30,7 +33,7 @@ jobs:
node-version: 16.x

- name: "Install contract dependencies"
run: yarn install
run: yarn install --frozen-lockfile
working-directory: ${{ env.contracts-working-directory }}

- name: "Build contracts"
Expand All @@ -39,11 +42,11 @@ jobs:

- name: "Install packages and start hardhat node"
run: |
yarn install
yarn install --frozen-lockfile
./tasks/startHardhatNode.sh start
working-directory: ${{ env.sdk-core-working-directory }}

# duplicated in call.check-query-schema-against-subgraph, call.setup-deploy-and-test-local-subgraph
# duplicated in call.setup-deploy-and-test-local-subgraph
- name: "Checkout graph node repo and set up local graph node"
uses: actions/checkout@v3
with:
Expand All @@ -68,19 +71,14 @@ jobs:
working-directory: ./packages/subgraph
#

- name: "Install @superfluid-finance/sdk-core@${{ matrix.version}}"
- name: "Install @superfluid-finance/sdk-core@${{ matrix.version}} and test subgraph queries"
run: |
yarn add -D @superfluid-finance/sdk-core@${{ matrix.version }}
yarn run-query-tests
working-directory: ./packages/sdk-core/previous-versions-testing

- name: "Test Schemas and Attempt Query Execution"
run: |
yarn install
./tasks/setupTestEnvironment.sh
./tasks/testSchemasAndQueries.sh
working-directory: ./packages/sdk-core
env:
SUBGRAPH_RELEASE_TAG: ${{ inputs.subgraph-release }}
SUBGRAPH_ENDPOINT: ${{ inputs.subgraph-endpoint }}

- name: "Stop Hardhat node"
run: ./tasks/startHardhatNode.sh stop
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CD | Create Hardhat-Deployer Stable Release Draft
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}

on:
workflow_dispatch:

push:
branches:
- "release-hardhat-deployer-stable"
paths:
- "packages/hardhat-deployer/**"
- ".github/workflows/cd.hardhat-deployer-stable.create-release-drafts.yml"

jobs:
create-release-draft:
name: Create Release Draft

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: https://registry.npmjs.org/

- name: Check package versions
id: check_versions
run: |
# hardhat-deployer
PUBLISHED_HARDHAT_DEPLOYER_VERSION=`npm show @superfluid-finance/hardhat-deployer@latest version`
NEW_HARDHAT_DEPLOYER_VERSION=`jq -r .version packages/hardhat-deployer/package.json`
if [ "$PUBLISHED_HARDHAT_DEPLOYER_VERSION" != "$NEW_HARDHAT_DEPLOYER_VERSION" ];then
echo "PUBLISHED_HARDHAT_DEPLOYER_VERSION=1" >> $GITHUB_ENV
echo "hardhat-deployer changed: $PUBLISHED_HARDHAT_DEPLOYER_VERSION -> $NEW_HARDHAT_DEPLOYER_VERSION"
else
echo "hardhat-deployer unchanged: $PUBLISHED_HARDHAT_DEPLOYER_VERSION"
fi
echo "::set-output name=NEW_HARDHAT_DEPLOYER_VERSION::$NEW_HARDHAT_DEPLOYER_VERSION"
- name: Create hardhat-deployer stable release draft
if: env.PUBLISHED_HARDHAT_DEPLOYER_VERSION == 1
id: create_release_hardhat_deployer
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: hardht-deployer@v${{ steps.check_versions.outputs.NEW_HARDHAT_DEPLOYER_VERSION }}
release_name: hardhat-deployer@v${{ steps.check_versions.outputs.NEW_HARDHAT_DEPLOYER_VERSION }}
body: |
Changes in this hardhat-deployer stable release
## Changed
## Added
## Fixes
## Breaking
draft: true
46 changes: 44 additions & 2 deletions .github/workflows/ci.canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
name: Test Query Schema and Queries Against Local and Deployed Dev Subgraphs with Previous SDK-Core Versions
with:
subgraph-release: dev
subgraph-endpoint: ''

# test query and subgraph schemas are in sync and query works
test-query-schema-against-deployed-dev-subgraphs:
Expand Down Expand Up @@ -165,9 +166,37 @@ jobs:
path: |
packages/sdk-core/coverage/
hardhat-deployer-coverage:
name: Run coverage test of hardhat-deployer on dev branch

if: github.repository == 'superfluid-finance/protocol-monorepo'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

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

- name: Run coverage test
run: |
yarn install --frozen-lockfile
yarn build
yarn workspace @superfluid-finance/hardhat-deployer test-coverage
- name: Create coverage artifact
uses: actions/upload-artifact@v3
with:
name: hardhat-deployer-coverage
path: |
packages/hardhat-deployer/coverage/
publish-coverage-reports:
name: Publish coverage reports
needs: [ethereum-contracts-coverage, js-sdk-coverage, sdk-core-coverage]
needs: [ethereum-contracts-coverage, js-sdk-coverage, sdk-core-coverage, hardhat-deployer-coverage]

runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -215,10 +244,23 @@ jobs:
flags: sdk-core
fail_ci_if_error: true

- name: Download hardhat-deployer-coverage
uses: actions/download-artifact@v3
with:
name: hardhat-deployer-coverage
path: packages/hardhat-deployer/coverage
- name: Upload hardhat-deployer-coverage to codecov
uses: codecov/codecov-action@v2
with:
files: packages/hardhat-deployer/coverage/lcov.info
name: hardhat-deployer-coverage
flags: hardhat-deployer
fail_ci_if_error: true

publish-npm-packages:
name: Publish canary packages to registries

needs: [essential-build-and-test, test-subgraph, ethereum-contracts-coverage, js-sdk-coverage, sdk-core-coverage]
needs: [essential-build-and-test, test-subgraph, ethereum-contracts-coverage, js-sdk-coverage, sdk-core-coverage, hardhat-deployer-coverage]

runs-on: ubuntu-latest

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/ci.feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
build_js_sdk: ${{ env.BUILD_JS_SDK }}
build_subgraph: ${{ env.BUILD_SUBGRAPH }}
build_sdk_core: ${{ env.BUILD_SDK_CORE }}
build_hardhat_deployer: ${{ env.BUILD_HARDHAT_DEPLOYER }}
build_spec_haskell: ${{ env.BUILD_SPEC_HASKELL }}

steps:
Expand Down Expand Up @@ -164,14 +165,23 @@ jobs:
name: Test Query Schema and Queries Against Local and Deployed Feature Subgraphs with Previous SDK-Core Versions
with:
subgraph-release: feature
subgraph-endpoint: http://localhost:8000/subgraphs/name/superfluid-test

# test query and local/deployed subgraph schemas in sync and query works
test-query-schema-against-deployed-feature-subgraphs:
uses: ./.github/workflows/call.check-query-schema-against-subgraph.yml
name: Test Query Schema and Queries Against Local and Deployed Feature Subgraphs
needs: [check]
if: needs.check.outputs.build_sdk_core
with:
subgraph-release: feature

test-hardhat-deployer:
uses: ./.github/workflows/call.test-hardhat-deployer.yml
name: Build and Test Hardhat-Deployer (Feature Branch)
needs: [check]
if: needs.check.outputs.build_hardhat_deployer

test-spec-haskell:
name: Build and test spec-haskell (Feature Branch) - Linux - ${{ matrix.compiler }}
needs: [check]
Expand Down Expand Up @@ -385,7 +395,7 @@ jobs:
runs-on: ubuntu-latest

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'superfluid-finance/protocol-monorepo') && always()
needs: [test-ethereum-contracts, coverage-ethereum-contracts, test-js-sdk, test-subgraph, test-sdk-core, test-spec-haskell]
needs: [test-ethereum-contracts, coverage-ethereum-contracts, test-js-sdk, test-subgraph, test-sdk-core, test-spec-haskell, test-subgraph-on-previous-sdk-core-versions, test-query-schema-against-deployed-feature-subgraphs, test-hardhat-deployer]

steps:
- name: Test Results
Expand All @@ -405,4 +415,7 @@ jobs:
check_result js-sdk ${{ needs.test-js-sdk.result }}
check_result subgraph ${{ needs.test-subgraph.result }}
check_result sdk-core ${{ needs.test-sdk-core.result }}
check_result sdk-core ${{ needs.test-spec-haskell.result }}
check_result spec-haskell ${{ needs.test-spec-haskell.result }}
check_result subgraph-on-previous-sdk-core-versions ${{ needs.test-subgraph-on-previous-sdk-core-versions.result }}
check_result query-schema-against-deployed-feature-subgraph ${{ needs.test-query-schema-against-deployed-feature-subgraphs.result }}
check_result test-hardhat-deployer ${{ needs.test-hardhat-deployer.result }}
1 change: 1 addition & 0 deletions .github/workflows/ci.pre-release-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ jobs:
# we want to check here if the subgraph implementation in dev is safe to use
# for v1 endpoints (backwards compatible)
subgraph-release: dev
subgraph-endpoint: ''
2 changes: 1 addition & 1 deletion .github/workflows/daily-slack-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Daily protocol-monorepo slack message

on:
schedule:
- cron: 0 11 * * *
- cron: 0 11 * * 1-5

jobs:
send-slack-message:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/handler.publish-pr-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
yarn add @superfluid-finance/ethereum-contracts@PR${{ steps.pr.outputs.pr_number }}
yarn add @superfluid-finance/sdk-core@PR${{ steps.pr.outputs.pr_number }}
yarn add @superfluid-finance/sdk-redux@PR${{ steps.pr.outputs.pr_number }}
yarn add @superfluid-finance/hardhat-deployer@PR${{ steps.pr.outputs.pr_number }}
```
<details><summary>:octocat: Click to learn how to use Github packages</summary>
Expand Down
Loading

0 comments on commit 736485a

Please sign in to comment.