Skip to content

Commit 1264449

Browse files
Merge branch 'feature/config-file-refactoring' of https://github.com/FrancescoDiMuro/java-tron into feature/config-file-refactoring
2 parents a7a7107 + cfed73d commit 1264449

48 files changed

Lines changed: 1552 additions & 1630 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
# The branches below must be a subset of the branches above
88
branches: [ 'develop' ]
9+
paths-ignore: [ '**/*.md', '.gitignore', '**/.gitignore', '.editorconfig',
10+
'.gitattributes', 'docs/**', 'CHANGELOG', '.github/ISSUE_TEMPLATE/**',
11+
'.github/PULL_REQUEST_TEMPLATE/**', '.github/CODEOWNERS' ]
912
schedule:
1013
- cron: '6 10 * * 0'
1114

@@ -29,16 +32,23 @@ jobs:
2932

3033
steps:
3134
- name: Checkout repository
32-
uses: actions/checkout@v4
35+
uses: actions/checkout@v5
3336

3437
# Initializes the CodeQL tools for scanning.
3538
- name: Initialize CodeQL
3639
uses: github/codeql-action/init@v4
3740
with:
3841
languages: ${{ matrix.language }}
42+
build-mode: manual
3943

40-
- name: Autobuild
41-
uses: github/codeql-action/autobuild@v4
44+
- name: Set up JDK 8
45+
uses: actions/setup-java@v5
46+
with:
47+
java-version: '8'
48+
distribution: 'temurin'
49+
50+
- name: Build
51+
run: ./gradlew build -x test --no-daemon
4252

4353
- name: Perform CodeQL Analysis
4454
uses: github/codeql-action/analyze@v4

.github/workflows/math-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616

1717
- name: Check for java.lang.Math usage
1818
id: check-math
@@ -55,14 +55,14 @@ jobs:
5555
5656
- name: Upload findings
5757
if: steps.check-math.outputs.math_found == 'true'
58-
uses: actions/upload-artifact@v4
58+
uses: actions/upload-artifact@v6
5959
with:
6060
name: math-usage-report
6161
path: math_usage.txt
6262

6363
- name: Create comment
6464
if: github.event_name == 'pull_request' && steps.check-math.outputs.math_found == 'true'
65-
uses: actions/github-script@v6
65+
uses: actions/github-script@v8
6666
with:
6767
script: |
6868
const fs = require('fs');

.github/workflows/pr-build.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: PR Build
2+
3+
on:
4+
pull_request:
5+
branches: [ 'master','develop', 'release_**' ]
6+
types: [ opened, synchronize, reopened ]
7+
paths-ignore: [ '**/*.md', '.gitignore', '**/.gitignore', '.editorconfig',
8+
'.gitattributes', 'docs/**', 'CHANGELOG', '.github/ISSUE_TEMPLATE/**',
9+
'.github/PULL_REQUEST_TEMPLATE/**', '.github/CODEOWNERS' ]
10+
workflow_dispatch:
11+
inputs:
12+
job:
13+
description: 'Job to run: all / macos / ubuntu / rockylinux / debian11'
14+
required: false
15+
default: 'all'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
23+
build-macos:
24+
name: Build macos26 (JDK ${{ matrix.java }} / ${{ matrix.arch }})
25+
if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'macos' }}
26+
runs-on: ${{ matrix.runner }}
27+
timeout-minutes: 60
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- java: '8'
33+
runner: macos-26-intel
34+
arch: x86_64
35+
- java: '17'
36+
runner: macos-26
37+
arch: aarch64
38+
39+
steps:
40+
- uses: actions/checkout@v5
41+
42+
- name: Set up JDK ${{ matrix.java }}
43+
uses: actions/setup-java@v5
44+
with:
45+
java-version: ${{ matrix.java }}
46+
distribution: 'temurin'
47+
48+
- name: Cache Gradle packages
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.gradle/caches
53+
~/.gradle/wrapper
54+
key: macos26-${{ matrix.arch }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
55+
restore-keys: macos26-${{ matrix.arch }}-gradle-
56+
57+
- name: Build
58+
run: ./gradlew clean build --no-daemon
59+
60+
- name: Test with RocksDB engine
61+
if: matrix.arch == 'x86_64'
62+
run: ./gradlew :framework:testWithRocksDb --no-daemon
63+
64+
build-ubuntu:
65+
name: Build ubuntu24 (JDK 17 / aarch64)
66+
if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'ubuntu' }}
67+
runs-on: ubuntu-24.04-arm
68+
timeout-minutes: 60
69+
70+
steps:
71+
- uses: actions/checkout@v5
72+
73+
- name: Set up JDK 17
74+
uses: actions/setup-java@v5
75+
with:
76+
java-version: '17'
77+
distribution: 'temurin'
78+
79+
- name: Check Java version
80+
run: java -version
81+
82+
- name: Cache Gradle packages
83+
uses: actions/cache@v4
84+
with:
85+
path: |
86+
~/.gradle/caches
87+
~/.gradle/wrapper
88+
key: ubuntu24-aarch64-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
89+
restore-keys: ubuntu24-aarch64-gradle-
90+
91+
- name: Build
92+
run: ./gradlew clean build --no-daemon
93+
94+
docker-build-rockylinux:
95+
name: Build rockylinux (JDK 8 / x86_64)
96+
if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'rockylinux' }}
97+
runs-on: ubuntu-latest
98+
timeout-minutes: 60
99+
100+
container:
101+
image: rockylinux:8
102+
103+
env:
104+
GRADLE_USER_HOME: /github/home/.gradle
105+
LANG: en_US.UTF-8
106+
LC_ALL: en_US.UTF-8
107+
108+
steps:
109+
- name: Checkout code
110+
uses: actions/checkout@v5
111+
112+
- name: Install dependencies (Rocky 8 + JDK8)
113+
run: |
114+
set -euxo pipefail
115+
dnf -y install java-1.8.0-openjdk-devel git wget unzip which jq bc curl glibc-langpack-en
116+
dnf -y groupinstall "Development Tools"
117+
118+
- name: Check Java version
119+
run: java -version
120+
121+
- name: Cache Gradle
122+
uses: actions/cache@v4
123+
with:
124+
path: |
125+
/github/home/.gradle/caches
126+
/github/home/.gradle/wrapper
127+
key: rockylinux-x86_64-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
128+
restore-keys: |
129+
rockylinux-x86_64-gradle-
130+
131+
- name: Stop Gradle daemon
132+
run: ./gradlew --stop || true
133+
134+
- name: Build
135+
run: ./gradlew clean build --no-daemon
136+
137+
- name: Test with RocksDB engine
138+
run: ./gradlew :framework:testWithRocksDb --no-daemon
139+
140+
docker-build-debian11:
141+
name: Build debian11 (JDK 8 / x86_64)
142+
if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'debian11' }}
143+
runs-on: ubuntu-latest
144+
timeout-minutes: 60
145+
146+
container:
147+
image: eclipse-temurin:8-jdk # base image is Debian 11 (Bullseye)
148+
149+
defaults:
150+
run:
151+
shell: bash
152+
153+
env:
154+
GRADLE_USER_HOME: /github/home/.gradle
155+
156+
steps:
157+
- name: Checkout code
158+
uses: actions/checkout@v5
159+
160+
- name: Install dependencies (Debian + build tools)
161+
run: |
162+
set -euxo pipefail
163+
apt-get update
164+
apt-get install -y git wget unzip build-essential curl jq
165+
166+
- name: Check Java version
167+
run: java -version
168+
169+
- name: Cache Gradle
170+
uses: actions/cache@v4
171+
with:
172+
path: |
173+
/github/home/.gradle/caches
174+
/github/home/.gradle/wrapper
175+
key: debian11-x86_64-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
176+
restore-keys: |
177+
debian11-x86_64-gradle-
178+
179+
- name: Build
180+
run: ./gradlew clean build --no-daemon
181+
182+
- name: Test with RocksDB engine
183+
run: ./gradlew :framework:testWithRocksDb --no-daemon

.github/workflows/pr-cancel.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Cancel PR Workflows on Close
2+
3+
on:
4+
pull_request:
5+
types: [ closed ]
6+
7+
permissions:
8+
actions: write
9+
10+
jobs:
11+
cancel:
12+
name: Cancel In-Progress Workflows
13+
if: github.event.pull_request.merged == false
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel PR Build and System Test
17+
uses: actions/github-script@v8
18+
with:
19+
script: |
20+
const workflows = ['pr-build.yml', 'system-test.yml', 'codeql.yml'];
21+
const headSha = context.payload.pull_request.head.sha;
22+
const prNumber = context.payload.pull_request.number;
23+
24+
for (const workflowId of workflows) {
25+
for (const status of ['in_progress', 'queued']) {
26+
const runs = await github.paginate(
27+
github.rest.actions.listWorkflowRuns,
28+
{
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
workflow_id: workflowId,
32+
status,
33+
event: 'pull_request',
34+
per_page: 100,
35+
},
36+
(response) => response.data.workflow_runs
37+
);
38+
39+
for (const run of runs) {
40+
const isTargetPr = !run.pull_requests?.length || run.pull_requests.some((pr) => pr.number === prNumber);
41+
if (run.head_sha === headSha && isTargetPr) {
42+
await github.rest.actions.cancelWorkflowRun({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
run_id: run.id,
46+
});
47+
console.log(`Cancelled ${workflowId} run #${run.id} (${status})`);
48+
}
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)