Skip to content

Commit

Permalink
Merge pull request #194 from VenusProtocol/pre-add-semantic-release
Browse files Browse the repository at this point in the history
Pre add semantic release
  • Loading branch information
coreyar authored Nov 22, 2024
2 parents b01ee90 + d90fe98 commit b28cbc9
Show file tree
Hide file tree
Showing 48 changed files with 6,239 additions and 2,034 deletions.
68 changes: 49 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: "yarn"

- name: Install deps
Expand Down Expand Up @@ -62,16 +62,16 @@ jobs:

- name: Generate Core Pool graphql types
run: |
docker exec -i subgraph-hardhat-node yarn workspace venus-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace venus-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace venus-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace venus-subgraph run deploy:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/core-pool-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/core-pool-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/core-pool-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/core-pool-subgraph run deploy:docker
sleep 5s
docker exec -i subgraph-hardhat-node yarn workspace venus-subgraph run generate-subgraph-types
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/core-pool-subgraph run generate-subgraph-types
- name: Run Core Pool integration tests
run: |
docker exec -i subgraph-hardhat-node yarn workspace venus-subgraph run test:integration --bail
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/core-pool-subgraph run test:integration --bail
- name: Stop containers
if: always()
Expand All @@ -95,16 +95,16 @@ jobs:

- name: Generate Isolated Pools graphql types
run: |
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run deploy:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/isolated-pools-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/isolated-pools-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/isolated-pools-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/isolated-pools-subgraph run deploy:docker
sleep 5s
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run generate-subgraph-types
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/isolated-pools-subgraph run generate-subgraph-types
- name: Run Isolated Pools integration tests
run: |
docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run test:integration --bail
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/isolated-pools-subgraph run test:integration --bail
- name: Stop containers
if: always()
Expand All @@ -128,19 +128,49 @@ jobs:

- name: Generate Governance graphql types
run: |
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run deploy:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/governance-subgraph run prepare:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/governance-subgraph run codegen
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/governance-subgraph run create:docker
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/governance-subgraph run deploy:docker
sleep 5s
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run generate-subgraph-types
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/governance-subgraph run generate-subgraph-types
- name: Run Governance integration integration tests
run: |
docker exec -i subgraph-hardhat-node yarn workspace venus-governance-subgraph run test:integration --bail
docker exec -i subgraph-hardhat-node yarn workspace @venusprotocol/governance-subgraph run test:integration --bail
- name: Stop containers
if: always()
run: |
docker compose down -v
docker system prune -f -a --volumes
release:
runs-on: ubuntu-20.04
# needs: [unit-test, lint, integration-test-core-pool, integration-test-isolated-pools, integration-test-governance]
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"

- name: Install deps
run: yarn

- name: Version subgraphs
env:
GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }}
GIT_AUTHOR_NAME: Venus Tools
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Venus Tools
GIT_COMMITTER_EMAIL: [email protected]
run: |
yarn workspace @venusprotocol/cross-chain-governance-subgraph run semantic-release
yarn workspace @venusprotocol/etherfi-promo-subgraph run semantic-release
yarn workspace @venusprotocol/isolated-pools-subgraph run semantic-release
yarn workspace @venusprotocol/protocol-reserve-subgraph run semantic-release
yarn workspace @venusprotocol/core-pool-subgraph run semantic-release
yarn workspace @venusprotocol/governance-subgraph run semantic-release
9 changes: 8 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
module.exports = {
...require('prettier-airbnb-config'),
trailingComma: 'all',
bracketSpacing: true,
importOrder: [
'^[./]',
],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
singleQuote: true,
printWidth: 100,
arrowParens: "avoid",
proseWrap: "always",
quoteProps: "as-needed",
semi: true,
tabWidth: 2,
useTabs: false
};
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.2.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.8.2.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.2.2.cjs
yarnPath: .yarn/releases/yarn-3.8.2.cjs

checksumBehavior: update
enableTransparentWorkspaces: false
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ createdb graph-node

Also, you might want to make sure test assertions are not being made against a state that was previously mutated by other test runs. To avoid this scenario, you will want to also recreate your Postgres DB and restart your ipfs and eth node services.


## Versioning / Deployments
Versioning is handled by semantic release based on formatted commits and the config defined in the `.releaserc` of each subgraph.
Branches with the `pre` prefix are versioned as pre-releases.

## Debugging
To query the indexing error use a graphql explorer like [GraphiQl](https://graphiql-online.com/graphiql) to query the graph node for the status of the graph. The endpoint for the hosted service is `https://api.thegraph.com/index-node/graphql`.

Expand Down
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
ignores: [commit => commit.includes("[skip ci]"), commit => commit.includes("Merge pull request")],
"type-enum": [2, "always", ["build", "chore", "ci", "docs", "feat", "fix", "refactor", "test"]],
};
36 changes: 9 additions & 27 deletions deploy/018-setup-markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,55 +115,37 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
vFdusdToken = await ethers.getContractAt('VToken', vFdusdToken.address);
vUsdtToken = await ethers.getContractAt('VToken', vUsdtToken.address);
await vUsdtToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);
await vDogeToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);
await vFdusdToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);

await comptroller._setComptrollerLens((await ethers.getContract('ComptrollerLens')).address);

await mine(1);

await vUsdcToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);
await vWBnbToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);
await vEthToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);

await vUsdtToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);
await vDogeToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);
await vFdusdToken.setProtocolShareReserve(
(
await ethers.getContract('ProtocolShareReserve')
).address,
(await ethers.getContract('ProtocolShareReserve')).address,
);

await vUsdcToken.accrueInterest();
Expand Down
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "subgraphs",
"name": "@venusprotocol/subgraphs",
"private": true,
"version": "0.0.0",
"repository": "https://github.com/VenusProtocol/subgraphs",
Expand All @@ -13,6 +13,7 @@
],
"scripts": {
"codegen": "yarn workspaces foreach run codegen",
"semantic-release": "yarn workspaces foreach run semantic-release",
"build:docker": "yarn workspaces foreach run build:docker",
"build:chapel": "yarn workspaces foreach run build:chapel",
"build:bsc": "yarn workspaces foreach run build:bsc",
Expand All @@ -33,6 +34,8 @@
},
"devDependencies": {
"@chainlink/contracts": "^0.5.1",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@graphprotocol/client-cli": "3.0.0",
"@graphprotocol/graph-cli": "^0.80.0",
"@graphprotocol/graph-ts": "^0.35.1",
Expand All @@ -41,7 +44,10 @@
"@nomicfoundation/hardhat-network-helpers": "^1.0.4",
"@nomiclabs/hardhat-ethers": "^2.1.1",
"@nomiclabs/hardhat-etherscan": "^3.1.0",
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"@types/mocha": "^9.1.1",
Expand Down Expand Up @@ -74,15 +80,15 @@
"module-alias": "^2.2.2",
"mustache": "^4.2.0",
"patch-package": "6.5.1",
"prettier": "^2.5.1",
"prettier-airbnb-config": "^1.0.0",
"prettier": "^3.0.3",
"ts-node": "^10.9.2",
"typechain": "^8.1.0",
"typescript": "^4.8.4"
},
"resolutions": {
"@venusprotocol/governance-contracts": "2.5.0-dev.4",
"@venusprotocol/venus-protocol": "9.3.0"
"@venusprotocol/venus-protocol": "9.3.0",
"prettier": "^3.0.3"
},
"husky": {
"hooks": {
Expand All @@ -92,5 +98,8 @@
"packageManager": "[email protected]",
"_moduleAliases": {
"@nomiclabs/hardhat-ethers": "node_modules/hardhat-deploy-ethers"
},
"dependencies": {
"semantic-release-yarn": "^3.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "venus-subgraph-utils",
"name": "@venusprotocol/subgraph-utils",
"version": "0.0.0",
"license": "MIT",
"main": "src",
Expand Down
86 changes: 86 additions & 0 deletions subgraphs/cross-chain-governance/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"extends": "semantic-release-monorepo",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"type": "build",
"release": false
},
{
"type": "chore",
"release": false
},
{
"type": "docs",
"release": "patch"
},
{
"type": "ci",
"release": false
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "test",
"release": false
}
],
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES"
]
}
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"semantic-release-yarn",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"yarn.lock"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
],
"branches": [
{
"name": "main"
},
{
"name": "pre-*",
"prerelease": "pre"
}
]
}
Loading

0 comments on commit b28cbc9

Please sign in to comment.