-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
370 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
|
||
- [ ] All [tests](https://github.com/attiasas/ois-core/actions/workflows/test.yml) passed. If this feature is not already covered by the tests, I added new tests. | ||
- [ ] If this feature effect users, update the [documentation](../README.md) and the [wiki](https://github.com/attiasas/ois-core/wiki) | ||
- [ ] This feature was validated on all supported platforms | ||
----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore for release | ||
categories: | ||
- title: Breaking Changes 🚨 | ||
labels: | ||
- breaking change | ||
- title: Exciting New Features 🎉 | ||
labels: | ||
- new feature | ||
- title: Improvements 🌱 | ||
labels: | ||
- improvement | ||
- title: Bug Fixes 🛠 | ||
labels: | ||
- bug | ||
- title: Other Changes 📚 | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "Static Analysis" | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
pull_request: | ||
|
||
permissions: | ||
checks: write | ||
|
||
jobs: | ||
spotbugs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
# Install required tools | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "corretto" | ||
java-version: "11" | ||
|
||
# Run tests | ||
- name: Run Spotbugs | ||
run: ./gradlew clean spotbugs | ||
|
||
# Show Spotbugs report | ||
- name: Show Spotbugs report | ||
uses: jwgmeligmeyling/spotbugs-github-action@master | ||
with: | ||
path: "build/reports/spotbugs/main/spotbugs.xml" | ||
if: failure() | ||
|
||
# Stop Gradle daemon | ||
- name: Stop Gradle | ||
run: ./gradlew --stop | ||
if: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "Test HTML Reflection not broken" | ||
# Some classes may not reflect, to make sure we are not breaking the runners we search for known blacklist imports | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
pull_request: | ||
|
||
jobs: | ||
check-blacklist-imports: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
# Install required tools | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "corretto" | ||
java-version: "11" | ||
|
||
- name: Define blacklisted packages and directories | ||
run: | | ||
# List of forbidden imports (blacklisted packages) | ||
BLACKLIST=("java.nio.file") | ||
# List of relative directories to search (after java/) | ||
RELATIVE_SEARCH_DIRS=("runner" "state" "project" "tools" "utils/io/data" "utils/log") | ||
# Base directory | ||
BASE_DIR="src/main/java/org/ois/core" | ||
# Loop over the blacklist | ||
for forbidden_pkg in "${BLACKLIST[@]}"; do | ||
# Search for forbidden imports in the specified relative directories | ||
for dir in "${RELATIVE_SEARCH_DIRS[@]}"; do | ||
FULL_PATH="$BASE_DIR/$dir" | ||
if grep -rnw "$FULL_PATH" -e "import $forbidden_pkg" --include \*.java; then | ||
echo "Error: Found forbidden import: $forbidden_pkg in $dir" | ||
exit 1 | ||
fi | ||
done | ||
done | ||
echo "No forbidden imports found." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Test" | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
pull_request: | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macOS-latest ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
# Install required tools | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "corretto" | ||
java-version: "11" | ||
# Run tests | ||
- name: Tests on macOS, Linux | ||
run: ./gradlew clean test | ||
if: runner.os != 'Windows' | ||
- name: Tests on Windows | ||
run: ./gradlew.bat clean test | ||
if: runner.os == 'Windows' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
package org.ois.core; | ||
|
||
import org.ois.core.runner.SimulationEngine; | ||
import org.ois.core.state.StateManager; | ||
|
||
/** | ||
* Static access to OIS utilities and shared objects | ||
*/ | ||
public class OIS { | ||
/** The active OIS engine that runs the simulation. **/ | ||
public static SimulationEngine engine; | ||
/** The State managers of the simulation **/ | ||
public static StateManager stateManager; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.