Add config files
Headless CI Tests / build (push) Has been cancelled
Run LinkedWarrantTest / build (push) Has been cancelled
Run Separate Tests / build (push) Has been cancelled
Static Analysis Java25 / build (push) Has been cancelled
Static Analysis / build (push) Has been cancelled
Typescript Check / tsc (push) Has been cancelled
Windows Java25 CI Tests / build (push) Has been cancelled
Windows CI Tests / build (push) Has been cancelled

This commit is contained in:
Serge NOEL
2026-06-17 14:17:22 +02:00
parent efdf1683af
commit 2c45fc244e
41 changed files with 2229 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Headless CI Tests
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run HeadLessTest with Maven
run: |
# run tests using maven with graphics suppressed
mvn test "-Djmri.skipTestsRequiringSeparateRunning=true" "-Djava.awt.headless=true" "-Dsurefire.printSummary=false"
+87
View File
@@ -0,0 +1,87 @@
name: New PR
permissions:
issues: write
pull-requests: write
on:
pull_request_target:
types: [opened, reopened, labeled, unlabeled, synchronize]
jobs:
check-pr:
runs-on: ubuntu-latest
env:
PR_LABEL: 'New PR'
BLOCK_HOURS: '24' # use e.g. 0.25 for testing
steps:
- name: Check PR age, label if recent, and block merging if labeled
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const pr = context.payload.pull_request;
const prNumber = pr.number;
const labelName = process.env.PR_LABEL;
const hoursLimit = parseFloat(process.env.BLOCK_HOURS);
// Helper function to get current labels on a PR
async function getPrLabels(owner, repo, prNumber) {
const labelsResp = await github.rest.issues.listLabelsOnIssue({
owner,
repo,
issue_number: prNumber
});
return labelsResp.data.map(l => l.name);
}
// Fetch PR details and labels
const { data: prDetails } = await github.rest.pulls.get({
owner,
repo,
pull_number: prNumber
});
var labelNames = await getPrLabels(owner, repo, prNumber);
// 1. Add or remove label based on age
const now = new Date();
const createdAt = new Date(prDetails.created_at);
const ageInHours = (now - createdAt) / (1000 * 60 * 60);
console.log(`️ PR #${prNumber} is ${ageInHours.toFixed(2)}h old.`);
if (ageInHours <= hoursLimit && !labelNames.includes(labelName)) {
console.log(`🔖 Adding label "${labelName}" to PR #${prNumber} as less than ${hoursLimit}h old.`);
try {
await github.rest.issues.addLabels({
owner,
repo,
issue_number: prNumber,
labels: [labelName]
});
labelNames.push(labelName); // Keep local list in sync
} catch (error) {
console.log(`⚠️ Could not add label "${labelName}": ${error.message}`);
}
} else if (ageInHours > hoursLimit && labelNames.includes(labelName)) {
console.log(`🔖 Removing label "${labelName}", PR age ${ageInHours.toFixed(2)}h.`);
try {
await github.rest.issues.removeLabel({
owner,
repo,
issue_number: prNumber,
name: labelName
});
labelNames = labelNames.filter(e => e !== labelName); // Update local array
} catch (error) {
console.log(`⚠️ Could not remove label "${labelName}": ${error.message}`);
}
}
// 2. Block merging if label still present
if (labelNames.includes(labelName)) {
core.setFailed(`❌ This pull request is a "${labelName}" and cannot be merged until ${hoursLimit} hours after creation.`);
} else {
console.log('✅ PR is mergeable.');
}
@@ -0,0 +1,35 @@
# This workflow will build a Java project with Maven-Ant then run LinkedWarrantTest
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Run LinkedWarrantTest
on: [ push, pull_request ]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and Run
run: |
# compile code and tests
mvn antrun:run -Danttarget=tests
# run individual tests
./scripts/run_linked_warrant_test jmri/jmrit/logix/LinkedWarrantTest.java
+39
View File
@@ -0,0 +1,39 @@
# This workflow will build a Java project with Maven-Ant then run individually-flagged tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Run Separate Tests
on: [ push, pull_request ]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and Run
run: |
# compile code and tests
mvn antrun:run -Danttarget=tests
# run individual tests
./scripts/run_flagged_tests_separately
- name: Check Line Ends
run: |
# reuses previous compile and tests targets
ant checklineends
+28
View File
@@ -0,0 +1,28 @@
name: Close inactive issues and PRs
on:
schedule:
- cron: "21 1 * * 1"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v10
with:
days-before-issue-stale: 45
days-before-issue-close: 30
stale-issue-label: "Pending closure"
close-issue-label: "Closed due to inactivity"
stale-issue-message: "This issue is stale because it has been open for 45 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 30 days since being marked as stale."
exempt-all-issue-assignees: true
days-before-pr-stale: 45
days-before-pr-close: 30
stale-pr-label: "Pending closure"
close-pr-label: "Closed due to inactivity"
stale-pr-message: "This PR is stale because it has been open for 45 days with no activity."
close-pr-message: "This PR was closed because it has been inactive for 30 days since being marked as stale."
repo-token: ${{ secrets.GITHUB_TOKEN }}
+51
View File
@@ -0,0 +1,51 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Static Analysis Java25
on: [ push, pull_request ]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 25
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: |
# compile with ECJ for warnings or errors
mvn antrun:run -Danttarget=tests-warnings-check
# run Spotbugs and Checkstyle
mvn clean test -U -P travis-spotbugs --batch-mode --file=pom.xml
# run Javadoc
mvn javadoc:javadoc -U --batch-mode --file=pom.xml
# check html
mvn exec:exec -P travis-scanhelp --file=pom.xml
# check properties
mvn antrun:run -Danttarget=checkPropertiesFiles
#run Architecture tests
mvn -Dtest=jmri.ArchitectureTest,jmri.TestArchitectureTest,jmri.util.FileLineEndingsCheck test --file=pom.xml
# Test if stale sources exists
./scripts/test_stale_sources.sh
# Test if if there are any files with with multiple UTF-8 Byte-Order-Marks (BOM) or TABs
./scripts/test_BOM_and_tab.sh
# Check that the default_lcf.xml and scripts/default.xml files are in synch.
./scripts/test_default_lcf.sh
# Check XSLT transformations
./scripts/test_decoder_XSLT_transforms.sh
+51
View File
@@ -0,0 +1,51 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Static Analysis
on: [ push, pull_request ]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: |
# compile with ECJ for warnings or errors
mvn antrun:run -Danttarget=tests-warnings-check
# run Spotbugs and Checkstyle
mvn clean test -U -P travis-spotbugs --batch-mode --file=pom.xml
# run Javadoc
mvn javadoc:javadoc -U --batch-mode --file=pom.xml
# check html
mvn exec:exec -P travis-scanhelp --file=pom.xml
# check properties
mvn antrun:run -Danttarget=checkPropertiesFiles
#run Architecture tests
mvn -Dtest=jmri.ArchitectureTest,jmri.TestArchitectureTest,jmri.util.FileLineEndingsCheck test --file=pom.xml
# Test if stale sources exists
./scripts/test_stale_sources.sh
# Test if if there are any files with with multiple UTF-8 Byte-Order-Marks (BOM) or TABs
./scripts/test_BOM_and_tab.sh
# Check that the default_lcf.xml and scripts/default.xml files are in synch.
./scripts/test_default_lcf.sh
# Check XSLT transformations
./scripts/test_decoder_XSLT_transforms.sh
+25
View File
@@ -0,0 +1,25 @@
# This workflow checks that Typescript code has been properly compiled
name: Typescript Check
on:
push:
pull_request:
jobs:
tsc:
name: tsc
runs-on: ubuntu-latest
steps:
# see https://github.com/marketplace/actions/typescript-compiler
- uses: actions/checkout@v5
- name: install node v24
uses: actions/setup-node@v6
with:
node-version: 24
- name: yarn install
run:
yarn install
- name: check changes
run: |
ant typescript
git diff --exit-code web/js
+41
View File
@@ -0,0 +1,41 @@
# This workflow will build a Java project with Maven
# For more information see: https://docs.github.com/en/actions/tutorials/build-and-test-code/java-with-maven
name: Windows Java25 CI Tests
on: [ push, pull_request ]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 25
- name: Change screen resolution
run: Set-DisplayResolution -Width 1600 -Height 1200 -Force
shell: pwsh
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Test with Maven
run: |
# run all tests using maven
mvn test "-Djmri.skipTestsRequiringSeparateRunning=true" "-Dsurefire.printSummary=true"
- name: Upload generated screenshots artifact
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshots
path: temp/temp/*
+41
View File
@@ -0,0 +1,41 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Windows CI Tests
on: [ push, pull_request ]
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 11
- name: Change screen resolution
run: Set-DisplayResolution -Width 1600 -Height 1200 -Force
shell: pwsh
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Test with Maven
run: |
# run all tests using maven
mvn test "-Djmri.skipTestsRequiringSeparateRunning=true" "-Dsurefire.printSummary=false"
- name: Upload generated screenshots artifact
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: screenshots
path: temp/temp/*