From 4fd6552384355dff42441bfeb4471d94f8622897 Mon Sep 17 00:00:00 2001 From: Deepak Bomjan Date: Sat, 22 Jun 2024 17:39:05 +0545 Subject: [PATCH 1/2] ci: configure codecov --- .github/workflows/java-codecov.yml | 23 +++++++++++++++++++ README.md | 1 + core-contracts/AssetManager/build.gradle | 2 +- core-contracts/BalancedOracle/build.gradle | 3 ++- core-contracts/BatchDisbursement/build.gradle | 9 ++++++++ core-contracts/Bribing/build.gradle | 2 +- core-contracts/DAOfund/build.gradle | 2 +- core-contracts/Dex/build.gradle | 3 ++- core-contracts/Dividends/build.gradle | 2 +- core-contracts/FeeHandler/build.gradle | 2 +- core-contracts/Governance/build.gradle | 2 +- core-contracts/Loans/build.gradle | 2 +- core-contracts/Multicall/build.gradle | 9 ++++++++ core-contracts/Rebalancing/build.gradle | 3 ++- core-contracts/Reserve/build.gradle | 2 +- core-contracts/Rewards/build.gradle | 7 +++++- core-contracts/Router/build.gradle | 2 +- core-contracts/Savings/build.gradle | 2 +- core-contracts/StakedLP/build.gradle | 3 ++- core-contracts/Staking/build.gradle | 2 +- score-lib/build.gradle | 2 +- .../SpokeAssetManager/build.gradle | 3 ++- .../SpokeBalancedDollar/build.gradle | 3 ++- test-lib/build.gradle | 10 ++++++++ token-contracts/BalancedDollar/build.gradle | 2 +- token-contracts/BalancedToken/build.gradle | 2 +- token-contracts/Sicx/build.gradle | 2 +- token-contracts/WorkerToken/build.gradle | 9 ++++++++ token-contracts/bBaln/build.gradle | 2 +- util-contracts/Burner/build.gradle | 10 ++++++++ util-contracts/DummyOracle/build.gradle | 10 ++++++++ util-contracts/OTC/build.gradle | 2 +- util-contracts/Stability/build.gradle | 10 ++++++++ util-contracts/Trickler/build.gradle | 2 +- util-contracts/XCallManager/build.gradle | 2 +- util-contracts/XCallMock/build.gradle | 10 ++++++++ xcall-annotations/build.gradle | 14 +++++++++++ 37 files changed, 152 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/java-codecov.yml diff --git a/.github/workflows/java-codecov.yml b/.github/workflows/java-codecov.yml new file mode 100644 index 000000000..04bd7807b --- /dev/null +++ b/.github/workflows/java-codecov.yml @@ -0,0 +1,23 @@ +name: Codecov javascore + +on: + push: + branches: + - "**" +env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +jobs: + Coverage-Codecov: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: true + - name: Javascore contracts coverage + run: ./gradlew test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + flags: java \ No newline at end of file diff --git a/README.md b/README.md index 107bb7291..74b534376 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![Gradle](https://img.shields.io/badge/gradle-7.4.2-blue) [![build](https://github.com/balancednetwork/balanced-java-contracts/actions/workflows/pr-test.yml/badge.svg?branch=main)](https://github.com/balancednetwork/balanced-java-contracts/actions/workflows/pr-test.yml) +[![codecov](https://codecov.io/gh/balancednetwork/balanced-java-contracts/graph/badge.svg?token=ESRLDMPPTG)](https://codecov.io/gh/balancednetwork/balanced-java-contracts) This repository contains the smart contracts for Balanced in Java. For python contracts check [balanced-contracts]( https://github.com/balancednetwork/balanced-contracts). diff --git a/core-contracts/AssetManager/build.gradle b/core-contracts/AssetManager/build.gradle index cc0e17254..60a271c11 100644 --- a/core-contracts/AssetManager/build.gradle +++ b/core-contracts/AssetManager/build.gradle @@ -106,7 +106,7 @@ test { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/BalancedOracle/build.gradle b/core-contracts/BalancedOracle/build.gradle index f6460ae13..27642f8a9 100644 --- a/core-contracts/BalancedOracle/build.gradle +++ b/core-contracts/BalancedOracle/build.gradle @@ -44,6 +44,7 @@ dependencies { testImplementation project(':test-lib') } + optimizedJar { mainClassName = 'network.balanced.score.core.balancedoracle.BalancedOracleImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -91,7 +92,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/BatchDisbursement/build.gradle b/core-contracts/BatchDisbursement/build.gradle index 499be1854..1f31cc733 100644 --- a/core-contracts/BatchDisbursement/build.gradle +++ b/core-contracts/BatchDisbursement/build.gradle @@ -84,3 +84,12 @@ tasks.named('test') { // Use JUnit Platform for unit tests. useJUnitPlatform() } + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} diff --git a/core-contracts/Bribing/build.gradle b/core-contracts/Bribing/build.gradle index 8b18b23fa..b849e64c6 100644 --- a/core-contracts/Bribing/build.gradle +++ b/core-contracts/Bribing/build.gradle @@ -92,7 +92,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/DAOfund/build.gradle b/core-contracts/DAOfund/build.gradle index e0901a264..550ed4ecb 100644 --- a/core-contracts/DAOfund/build.gradle +++ b/core-contracts/DAOfund/build.gradle @@ -98,7 +98,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Dex/build.gradle b/core-contracts/Dex/build.gradle index fe7f89421..37ee967af 100644 --- a/core-contracts/Dex/build.gradle +++ b/core-contracts/Dex/build.gradle @@ -65,6 +65,7 @@ dependencies { } + optimizedJar { mainClassName = 'network.balanced.score.core.dex.DexImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -116,7 +117,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Dividends/build.gradle b/core-contracts/Dividends/build.gradle index 5a4a1265e..fb3175029 100644 --- a/core-contracts/Dividends/build.gradle +++ b/core-contracts/Dividends/build.gradle @@ -100,7 +100,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/FeeHandler/build.gradle b/core-contracts/FeeHandler/build.gradle index eac1dd2cd..64e074800 100644 --- a/core-contracts/FeeHandler/build.gradle +++ b/core-contracts/FeeHandler/build.gradle @@ -89,7 +89,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Governance/build.gradle b/core-contracts/Governance/build.gradle index 7b3db98d1..c8cb73ff8 100644 --- a/core-contracts/Governance/build.gradle +++ b/core-contracts/Governance/build.gradle @@ -105,7 +105,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Loans/build.gradle b/core-contracts/Loans/build.gradle index ef17c6487..bcce5240f 100644 --- a/core-contracts/Loans/build.gradle +++ b/core-contracts/Loans/build.gradle @@ -98,7 +98,7 @@ test { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Multicall/build.gradle b/core-contracts/Multicall/build.gradle index ed1a752b3..6a7371194 100644 --- a/core-contracts/Multicall/build.gradle +++ b/core-contracts/Multicall/build.gradle @@ -81,3 +81,12 @@ tasks.named('test') { // Use JUnit Platform for unit tests. useJUnitPlatform() } + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} diff --git a/core-contracts/Rebalancing/build.gradle b/core-contracts/Rebalancing/build.gradle index 2a93d29c5..3819ae743 100644 --- a/core-contracts/Rebalancing/build.gradle +++ b/core-contracts/Rebalancing/build.gradle @@ -40,6 +40,7 @@ dependencies { testImplementation project(':test-lib') } + optimizedJar { mainClassName = 'network.balanced.score.core.rebalancing.RebalancingImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -93,7 +94,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Reserve/build.gradle b/core-contracts/Reserve/build.gradle index 46a2031ad..d236728f9 100644 --- a/core-contracts/Reserve/build.gradle +++ b/core-contracts/Reserve/build.gradle @@ -98,7 +98,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Rewards/build.gradle b/core-contracts/Rewards/build.gradle index d8de9d358..1de4297c1 100644 --- a/core-contracts/Rewards/build.gradle +++ b/core-contracts/Rewards/build.gradle @@ -43,6 +43,11 @@ dependencies { intTestImplementation Dependencies.jacksonDatabind } +test { + useJUnitPlatform() + finalizedBy jacocoTestReport +} + optimizedJar { mainClassName = 'network.balanced.score.core.rewards.RewardsImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -96,7 +101,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Router/build.gradle b/core-contracts/Router/build.gradle index c53aedf2a..61298ffd8 100644 --- a/core-contracts/Router/build.gradle +++ b/core-contracts/Router/build.gradle @@ -94,7 +94,7 @@ test { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Savings/build.gradle b/core-contracts/Savings/build.gradle index f48e4dfda..25f3b7851 100644 --- a/core-contracts/Savings/build.gradle +++ b/core-contracts/Savings/build.gradle @@ -99,7 +99,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/StakedLP/build.gradle b/core-contracts/StakedLP/build.gradle index b75873b9b..455a4f499 100644 --- a/core-contracts/StakedLP/build.gradle +++ b/core-contracts/StakedLP/build.gradle @@ -46,6 +46,7 @@ dependencies { intTestImplementation Dependencies.jacksonDatabind } + optimizedJar { mainClassName = 'network.balanced.score.core.stakedlp.StakedLPImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -97,7 +98,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/core-contracts/Staking/build.gradle b/core-contracts/Staking/build.gradle index 6cf26560a..11de3fa82 100644 --- a/core-contracts/Staking/build.gradle +++ b/core-contracts/Staking/build.gradle @@ -100,7 +100,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/score-lib/build.gradle b/score-lib/build.gradle index 79b56c840..f0ce97d3c 100644 --- a/score-lib/build.gradle +++ b/score-lib/build.gradle @@ -59,7 +59,7 @@ test { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/spoke-contracts/SpokeAssetManager/build.gradle b/spoke-contracts/SpokeAssetManager/build.gradle index 234cb3e09..ebd579412 100644 --- a/spoke-contracts/SpokeAssetManager/build.gradle +++ b/spoke-contracts/SpokeAssetManager/build.gradle @@ -49,6 +49,7 @@ dependencies { testImplementation project(':test-lib') } + optimizedJar { mainClassName = 'network.balanced.score.spoke.asset.manager.SpokeAssetManagerImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -87,7 +88,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/spoke-contracts/SpokeBalancedDollar/build.gradle b/spoke-contracts/SpokeBalancedDollar/build.gradle index e61b221f0..bfceb442c 100644 --- a/spoke-contracts/SpokeBalancedDollar/build.gradle +++ b/spoke-contracts/SpokeBalancedDollar/build.gradle @@ -49,6 +49,7 @@ dependencies { testImplementation project(':test-lib') } + optimizedJar { mainClassName = 'network.balanced.score.spoke.bnusd.SpokeBalancedDollarImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -87,7 +88,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/test-lib/build.gradle b/test-lib/build.gradle index 84bb518b1..8d2eedcea 100644 --- a/test-lib/build.gradle +++ b/test-lib/build.gradle @@ -49,4 +49,14 @@ dependencies { test { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } } \ No newline at end of file diff --git a/token-contracts/BalancedDollar/build.gradle b/token-contracts/BalancedDollar/build.gradle index 11c75149b..4c2f5909c 100644 --- a/token-contracts/BalancedDollar/build.gradle +++ b/token-contracts/BalancedDollar/build.gradle @@ -92,7 +92,7 @@ test { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/token-contracts/BalancedToken/build.gradle b/token-contracts/BalancedToken/build.gradle index 0c5ebe431..b49057ab2 100644 --- a/token-contracts/BalancedToken/build.gradle +++ b/token-contracts/BalancedToken/build.gradle @@ -93,7 +93,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/token-contracts/Sicx/build.gradle b/token-contracts/Sicx/build.gradle index 83bb30407..1db63544e 100644 --- a/token-contracts/Sicx/build.gradle +++ b/token-contracts/Sicx/build.gradle @@ -95,7 +95,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/token-contracts/WorkerToken/build.gradle b/token-contracts/WorkerToken/build.gradle index 9bfbf4fd4..3b37c6844 100644 --- a/token-contracts/WorkerToken/build.gradle +++ b/token-contracts/WorkerToken/build.gradle @@ -74,8 +74,17 @@ deployJar { test { useJUnitPlatform() + finalizedBy jacocoTestReport } +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} optimizedJar { mainClassName = 'network.balanced.score.tokens.workertoken.WorkerTokenImpl' duplicatesStrategy = DuplicatesStrategy.EXCLUDE diff --git a/token-contracts/bBaln/build.gradle b/token-contracts/bBaln/build.gradle index 88ddaf638..fa721cf33 100644 --- a/token-contracts/bBaln/build.gradle +++ b/token-contracts/bBaln/build.gradle @@ -96,7 +96,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/util-contracts/Burner/build.gradle b/util-contracts/Burner/build.gradle index 49954afbc..2252a5420 100644 --- a/util-contracts/Burner/build.gradle +++ b/util-contracts/Burner/build.gradle @@ -83,4 +83,14 @@ deployJar { test { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } } \ No newline at end of file diff --git a/util-contracts/DummyOracle/build.gradle b/util-contracts/DummyOracle/build.gradle index bd94ca55b..f26cf9dce 100644 --- a/util-contracts/DummyOracle/build.gradle +++ b/util-contracts/DummyOracle/build.gradle @@ -68,4 +68,14 @@ deployJar { test { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } } \ No newline at end of file diff --git a/util-contracts/OTC/build.gradle b/util-contracts/OTC/build.gradle index 38dcb8b40..d0706a95d 100644 --- a/util-contracts/OTC/build.gradle +++ b/util-contracts/OTC/build.gradle @@ -88,7 +88,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/util-contracts/Stability/build.gradle b/util-contracts/Stability/build.gradle index eaf5489b2..eb2a67a20 100644 --- a/util-contracts/Stability/build.gradle +++ b/util-contracts/Stability/build.gradle @@ -91,4 +91,14 @@ deployJar { test { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } } \ No newline at end of file diff --git a/util-contracts/Trickler/build.gradle b/util-contracts/Trickler/build.gradle index 5cb5adb1e..370b3d791 100644 --- a/util-contracts/Trickler/build.gradle +++ b/util-contracts/Trickler/build.gradle @@ -82,7 +82,7 @@ test { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/util-contracts/XCallManager/build.gradle b/util-contracts/XCallManager/build.gradle index dd59beb56..aa24bd39c 100644 --- a/util-contracts/XCallManager/build.gradle +++ b/util-contracts/XCallManager/build.gradle @@ -95,7 +95,7 @@ tasks.named('test') { jacocoTestReport { dependsOn test reports { - xml.required = false + xml.required = true csv.required = false html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } diff --git a/util-contracts/XCallMock/build.gradle b/util-contracts/XCallMock/build.gradle index 5dcb20793..f557ce1f3 100644 --- a/util-contracts/XCallMock/build.gradle +++ b/util-contracts/XCallMock/build.gradle @@ -89,4 +89,14 @@ deployJar { test { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } } \ No newline at end of file diff --git a/xcall-annotations/build.gradle b/xcall-annotations/build.gradle index 1ab0fc306..cdd51acee 100644 --- a/xcall-annotations/build.gradle +++ b/xcall-annotations/build.gradle @@ -41,3 +41,17 @@ dependencies { implementation Dependencies.jacksonDatabind implementation Dependencies.iconSdk } + +test { + useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} \ No newline at end of file From 9b403ac9335f6fd16f790321c657ecb78dfe60ad Mon Sep 17 00:00:00 2001 From: Deepak Bomjan Date: Mon, 24 Jun 2024 09:39:05 +0545 Subject: [PATCH 2/2] ci: add ci checks --- .github/ISSUE_TEMPLATE/bug_report.md | 24 +++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++ .github/ISSUE_TEMPLATE/task-template.md | 27 +++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 27 +++++++++++++++++++ .github/labeler.yml | 15 +++++++++++ .github/workflows/auto-pr-labeler.yml | 33 +++++++++++++++++++++++ .github/workflows/check-pr-label.yml | 21 +++++++++++++++ .github/workflows/lint-pr.yaml | 18 +++++++++++++ 8 files changed, 185 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/task-template.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/auto-pr-labeler.yml create mode 100644 .github/workflows/check-pr-label.yml create mode 100644 .github/workflows/lint-pr.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..ddf85ea2d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,24 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: iBriz +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..bbcbbe7d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/task-template.md b/.github/ISSUE_TEMPLATE/task-template.md new file mode 100644 index 000000000..3165c4c23 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/task-template.md @@ -0,0 +1,27 @@ +--- +name: Task template +about: Capture details for the tasks +title: '' +labels: iBriz +assignees: '' + +--- + +### What needs to be done + +Describe what needs to be done here. +Ex: "Relay synchronization starts from the most recently stored block header" + +### Why it needs to be done + +Describe why it needs to be done here. +Ex: "Reduces the amount of time for the relay to synchronize to the latest block" + +### Acceptance Criteria + +Describe how we can know whether the task is done. +Ex: When restarting the relay, synchronization picks up from the most recently stored block + +### Additional Information + +Describe anything relevant that hasn't been mentioned yet. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..c8a8cd2f9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ +## Description: + +### Commit Message + +```bash +type: commit message +``` + +see the [guidelines](https://github.com/icon-project/community/blob/main/guidelines/technical/software-development-guidelines.md#commit-messages) for commit messages. + +### Changelog Entry + +```bash +version: +``` + +## Checklist: + +- [ ] I have performed a self-review of my own code +- [ ] I have documented my code in accordance with the [documentation guidelines](https://github.com/icon-project/community/blob/main/guidelines/technical/software-development-guidelines.md#documentation) +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have run the unit tests +- [ ] I only have one commit (if not, squash them into one commit). +- [ ] I have a descriptive commit message that adheres to the [commit message guidelines](https://github.com/icon-project/community/blob/main/guidelines/technical/software-development-guidelines.md#commit-messages) + +> Please review the [CONTRIBUTING.md](/CONTRIBUTING.md) file for detailed contributing guidelines. diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..8b3526ab0 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,15 @@ +cicd: + - '.github/workflows/*' + +scripts: + - 'scripts/*' + +test: + - 'test/**' + +documentation: +- '**/*.md' + +docker: +- 'docker/**' + diff --git a/.github/workflows/auto-pr-labeler.yml b/.github/workflows/auto-pr-labeler.yml new file mode 100644 index 000000000..36086e834 --- /dev/null +++ b/.github/workflows/auto-pr-labeler.yml @@ -0,0 +1,33 @@ +name: Pull Request Labeler +on: + pull_request: + types: + - opened + - edited + - synchronize +jobs: + auto-label: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Find Current Pull Request + uses: jwalton/gh-find-current-pr@v1.3.2 + id: findPr + with: + # Can be "open", "closed", or "all". Defaults to "open". + state: open + - run: echo "PR Number is ${PR}" + if: success() && steps.findPr.outputs.number + env: + PR: ${{ steps.findPr.outputs.pr }} + + - name: check pr pr-number + run: echo ${{ github.event.number }} + + - uses: actions/labeler@v4 + with: + dot: true + pr-number: ${{ steps.findPr.outputs.pr }} + diff --git a/.github/workflows/check-pr-label.yml b/.github/workflows/check-pr-label.yml new file mode 100644 index 000000000..754274771 --- /dev/null +++ b/.github/workflows/check-pr-label.yml @@ -0,0 +1,21 @@ +name: PR Label Checker +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + +jobs: + + check_labels: + name: Check PR labels + runs-on: ubuntu-latest + steps: + - uses: docker://agilepathway/pull-request-label-checker:latest + with: + any_of: documentation,enhancement,bug,cicd,test,breaking-change,feature,scripts + repo_token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml new file mode 100644 index 000000000..dca39a43e --- /dev/null +++ b/.github/workflows/lint-pr.yaml @@ -0,0 +1,18 @@ +name: Lint PR +on: + pull_request_target: + types: + - opened + - edited + - synchronize +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + validateSingleCommit: true + validateSingleCommitMatchesPrTitle: true