Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: configure codecov #425

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -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.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/task-template.md
Original file line number Diff line number Diff line change
@@ -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.
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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: <log entry>
```

## 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.
15 changes: 15 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cicd:
- '.github/workflows/*'

scripts:
- 'scripts/*'

test:
- 'test/**'

documentation:
- '**/*.md'

docker:
- 'docker/**'

33 changes: 33 additions & 0 deletions .github/workflows/auto-pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}

21 changes: 21 additions & 0 deletions .github/workflows/check-pr-label.yml
Original file line number Diff line number Diff line change
@@ -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 }}

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
18 changes: 18 additions & 0 deletions .github/workflows/lint-pr.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: true
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
Loading
Loading