Skip to content
Merged
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
214 changes: 108 additions & 106 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,54 +93,54 @@ jobs:
core.info('PR lint passed.');
}

# build:
# name: Build ${{ matrix.os-name }}(JDK ${{ matrix.java }} / ${{ matrix.arch }})
# needs: pr-lint
# runs-on: ${{ matrix.runner }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - java: '8'
# runner: ubuntu-latest
# os-name: ubuntu
# arch: x86_64
# - java: '17'
# runner: ubuntu-24.04-arm
# os-name: ubuntu
# arch: aarch64
# - java: '8'
# runner: macos-26-intel
# os-name: macos
# arch: x86_64
# - java: '17'
# runner: macos-latest
# os-name: macos
# arch: aarch64
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Set up JDK ${{ matrix.java }}
# uses: actions/setup-java@v4
# with:
# java-version: ${{ matrix.java }}
# distribution: 'temurin'
#
# - name: Cache Gradle packages
# uses: actions/cache@v4
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-${{ matrix.arch }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
# restore-keys: ${{ runner.os }}-${{ matrix.arch }}-gradle-
#
# - name: Build
# run: ./gradlew clean build --no-daemon

docker-build-centos8:
name: Build centos8 (JDK 8 / x86_64)
build:
name: Build ${{ matrix.os-name }}(JDK ${{ matrix.java }} / ${{ matrix.arch }})
needs: pr-lint
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- java: '8'
runner: ubuntu-latest
os-name: ubuntu
arch: x86_64
- java: '17'
runner: ubuntu-24.04-arm
os-name: ubuntu
arch: aarch64
- java: '8'
runner: macos-26-intel
os-name: macos
arch: x86_64
- java: '17'
runner: macos-latest
os-name: macos
arch: aarch64

steps:
- uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

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

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

docker-build-rockylinux:
name: Build rockylinux (JDK 8 / x86_64)
needs: pr-lint
runs-on: ubuntu-latest

Expand All @@ -149,6 +149,8 @@ jobs:

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

steps:
- name: Checkout code
Expand All @@ -157,7 +159,7 @@ jobs:
- 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
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
Expand All @@ -169,9 +171,9 @@ jobs:
path: |
/github/home/.gradle/caches
/github/home/.gradle/wrapper
key: ${{ runner.os }}-centos8-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
key: ${{ runner.os }}-rockylinux-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-centos8-gradle-
${{ runner.os }}-rockylinux-gradle-

- name: Prepare checkstyle config copy
run: |
Expand All @@ -185,72 +187,72 @@ jobs:
run: ./gradlew --stop || true

- name: Build
#run: ./gradlew clean build --no-daemon --no-build-cache
run: |
./gradlew clean build -x test --no-daemon --no-build-cache
./gradlew framework:test --tests org.tron.core.zksnark.ShieldedReceiveTest
run: ./gradlew clean build --no-daemon --no-build-cache
#run: |
# ./gradlew clean build -x test --no-daemon --no-build-cache
# ./gradlew framework:test --tests org.tron.core.zksnark.ShieldedReceiveTest

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

- name: Upload JaCoCo artifacts
uses: actions/upload-artifact@v4
with:
name: jacoco-centos8
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)
# needs: pr-lint
# runs-on: ubuntu-latest
#
# container:
# image: eclipse-temurin:8-jdk
#
# defaults:
# run:
# shell: bash
#
# env:
# GRADLE_USER_HOME: /github/home/.gradle
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Install dependencies (Debian + build tools)
# run: |
# set -euxo pipefail
# apt-get update
# apt-get install -y git wget unzip build-essential curl jq
#
# - 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 }}-debian11-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-debian11-gradle-
#
# - name: Grant execute permission
# run: chmod +x gradlew
#
# - name: Build
# run: ./gradlew clean build --no-daemon
docker-build-debian11:
name: Build debian11 (JDK 8 / x86_64)
needs: pr-lint
runs-on: ubuntu-latest

container:
image: eclipse-temurin:8-jdk # base image is Debian 11 (Bullseye)

defaults:
run:
shell: bash

env:
GRADLE_USER_HOME: /github/home/.gradle

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

- name: Install dependencies (Debian + build tools)
run: |
set -euxo pipefail
apt-get update
apt-get install -y git wget unzip build-essential curl jq

- 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 }}-debian11-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-debian11-gradle-

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

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


coverage-gate:
name: Coverage Gate (from centos8 build)
needs: docker-build-centos8
name: Coverage Gate (from rockylinux build)
needs: docker-build-rockylinux
runs-on: ubuntu-latest

permissions:
Expand All @@ -264,23 +266,23 @@ jobs:
- name: Checkout code (needed by codecov-action for git context)
uses: actions/checkout@v4

- name: Download JaCoCo artifacts (centos8)
- name: Download JaCoCo artifacts (rockylinux)
uses: actions/download-artifact@v4
with:
name: jacoco-centos8
path: artifacts/jacoco-centos8
name: jacoco-rockylinux
path: artifacts/jacoco-rockylinux

- name: List downloaded reports
run: |
set -eux
echo "JaCoCo XML reports found:"
find artifacts/jacoco-centos8 -name jacocoTestReport.xml
find artifacts/jacoco-rockylinux -name jacocoTestReport.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: artifacts/jacoco-centos8
directory: artifacts/jacoco-rockylinux
override_commit: ${{ github.event.pull_request.head.sha }}
override_branch: ${{ github.event.pull_request.head.ref }}
override_pr: ${{ github.event.pull_request.number }}
Expand Down