Skip to content
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
60 changes: 60 additions & 0 deletions .github/workflows/codecov-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Codecov Upload

on:
workflow_run:
workflows: ["RockyLinux Coverage Build"]
types: [completed]
branches: [ 'develop', 'release_**' ]

jobs:
upload-coverage:
name: Upload Coverage

if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request'

runs-on: ubuntu-latest
timeout-minutes: 10

steps:

- name: Extract PR info
id: pr
uses: actions/github-script@v7
with:
script: |
const prs = context.payload.workflow_run.pull_requests;

if (!prs || prs.length === 0) {
core.setFailed("No PR found");
return;
}

const pr = prs[0];
core.setOutput("number", pr.number);
core.setOutput("sha", pr.head.sha);
core.setOutput("ref", pr.head.ref);
core.setOutput("run", context.payload.workflow_run.id);

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: jacoco-rockylinux
run-id: ${{ steps.pr.outputs.run }}
path: coverage
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Show files
run: find coverage -type f

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/**/jacocoTestReport.xml
disable_search: true
override_commit: ${{ steps.pr.outputs.sha }}
override_branch: ${{ steps.pr.outputs.ref }}
override_pr: ${{ steps.pr.outputs.number }}
fail_ci_if_error: true
60 changes: 0 additions & 60 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,66 +178,6 @@ jobs:
- name: Build
run: ./gradlew clean build --no-daemon

docker-build-rockylinux:
name: Build rockylinux (JDK 8 / x86_64)
if: github.event.action != 'edited' && !failure()
needs: [pr-lint, checkstyle]
runs-on: ubuntu-latest
timeout-minutes: 60

container:
image: rockylinux:8

env:
GRADLE_USER_HOME: /github/home/.gradle
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies (Rocky 8 + JDK8)
run: |
set -euxo pipefail
dnf -y install java-1.8.0-openjdk-devel git wget unzip which jq bc curl glibc-langpack-en
dnf -y groupinstall "Development Tools"

- name: Check Java version
run: java -version

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
/github/home/.gradle/caches
/github/home/.gradle/wrapper
key: ${{ runner.os }}-rockylinux-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-rockylinux-gradle-

- name: Grant execute permission
run: chmod +x gradlew

- name: Stop Gradle daemon
run: ./gradlew --stop || true

- name: Build
run: ./gradlew clean build --no-daemon --no-build-cache

- name: Generate JaCoCo report
run: ./gradlew jacocoTestReport --no-daemon --no-build-cache

- name: Upload JaCoCo artifacts
uses: actions/upload-artifact@v4
with:
name: jacoco-rockylinux
path: |
**/build/reports/jacoco/test/jacocoTestReport.xml
**/build/reports/**
**/build/test-results/**
if-no-files-found: error

docker-build-debian11:
name: Build debian11 (JDK 8 / x86_64)
if: github.event.action != 'edited' && !failure()
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/rockylinux-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: RockyLinux Coverage Build

on:
pull_request:
branches: [ 'develop', 'release_**' ]
types: [ opened, synchronize, reopened ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

permissions:
contents: read

jobs:

docker-build-rockylinux:
name: Build rockylinux (JDK8)

runs-on: ubuntu-latest
timeout-minutes: 60

container:
image: rockylinux:8

env:
GRADLE_USER_HOME: /github/home/.gradle

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
dnf -y install java-1.8.0-openjdk-devel git wget unzip which jq bc curl

- name: Java version
run: java -version

- name: Build
run: |
chmod +x gradlew
./gradlew clean build --no-daemon --no-build-cache

- name: Generate coverage
run: |
./gradlew jacocoTestReport --no-daemon --no-build-cache

- name: Upload jacoco artifact
uses: actions/upload-artifact@v4
with:
name: jacoco-rockylinux
path: |
**/build/reports/jacoco/test/jacocoTestReport.xml
**/build/test-results/**
**/build/reports/**
if-no-files-found: error
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
comment: false

coverage:
status:
project:
default:
target: auto # must not decrease from base branch
threshold: 0.1% # allow 0.1% fluctuation
patch:
default:
target: 0% # minimum coverage for changed lines
1 change: 1 addition & 0 deletions framework/src/test/java/org/tron/common/TestConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public class TestConstants {

public static final String TEST_CONF = "config-test.conf";
public static final String NET_CONF = "config.conf";

}
Loading