Skip to content

Commit

Permalink
ci: configure codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakBomjan committed Jun 22, 2024
1 parent 63634eb commit 4fd6552
Show file tree
Hide file tree
Showing 37 changed files with 152 additions and 26 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/java-codecov.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/AssetManager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.required = false
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
Expand Down
3 changes: 2 additions & 1 deletion core-contracts/BalancedOracle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
testImplementation project(':test-lib')
}


optimizedJar {
mainClassName = 'network.balanced.score.core.balancedoracle.BalancedOracleImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
9 changes: 9 additions & 0 deletions core-contracts/BatchDisbursement/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
2 changes: 1 addition & 1 deletion core-contracts/Bribing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/DAOfund/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
3 changes: 2 additions & 1 deletion core-contracts/Dex/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ dependencies {

}


optimizedJar {
mainClassName = 'network.balanced.score.core.dex.DexImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Dividends/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/FeeHandler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Governance/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Loans/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.required = false
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
Expand Down
9 changes: 9 additions & 0 deletions core-contracts/Multicall/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
3 changes: 2 additions & 1 deletion core-contracts/Rebalancing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies {
testImplementation project(':test-lib')
}


optimizedJar {
mainClassName = 'network.balanced.score.core.rebalancing.RebalancingImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Reserve/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
7 changes: 6 additions & 1 deletion core-contracts/Rewards/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ dependencies {
intTestImplementation Dependencies.jacksonDatabind
}

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

optimizedJar {
mainClassName = 'network.balanced.score.core.rewards.RewardsImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Router/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.required = false
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Savings/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
3 changes: 2 additions & 1 deletion core-contracts/StakedLP/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dependencies {
intTestImplementation Dependencies.jacksonDatabind
}


optimizedJar {
mainClassName = 'network.balanced.score.core.stakedlp.StakedLPImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion core-contracts/Staking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion score-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.required = false
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
Expand Down
3 changes: 2 additions & 1 deletion spoke-contracts/SpokeAssetManager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies {
testImplementation project(':test-lib')
}


optimizedJar {
mainClassName = 'network.balanced.score.spoke.asset.manager.SpokeAssetManagerImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
3 changes: 2 additions & 1 deletion spoke-contracts/SpokeBalancedDollar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies {
testImplementation project(':test-lib')
}


optimizedJar {
mainClassName = 'network.balanced.score.spoke.bnusd.SpokeBalancedDollarImpl'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down Expand Up @@ -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')
}
Expand Down
10 changes: 10 additions & 0 deletions test-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
2 changes: 1 addition & 1 deletion token-contracts/BalancedDollar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.required = false
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
Expand Down
2 changes: 1 addition & 1 deletion token-contracts/BalancedToken/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
2 changes: 1 addition & 1 deletion token-contracts/Sicx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
9 changes: 9 additions & 0 deletions token-contracts/WorkerToken/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion token-contracts/bBaln/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
10 changes: 10 additions & 0 deletions util-contracts/Burner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
10 changes: 10 additions & 0 deletions util-contracts/DummyOracle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
Loading

0 comments on commit 4fd6552

Please sign in to comment.