Skip to content
Merged

Dev #23

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
18352df
0.9.5: API module and config updates
OhACD Dec 22, 2025
046c76c
0.9.5: Unit test Module
OhACD Dec 22, 2025
5b8e01d
0.9.5: CI/CD and Testing Suite
OhACD Dec 22, 2025
bc831cf
0.9.5: Testing Bug Fixes
OhACD Dec 22, 2025
cfa4b6d
0.9.5: Fixed workflows
OhACD Dec 22, 2025
539de96
0.9.5: Spectator support
OhACD Dec 22, 2025
c09fb2d
0.9.5: testing
OhACD Dec 22, 2025
a48ca3d
Change session creation to use createSessionBuilder
OhACD Dec 23, 2025
7dba7d0
Add API annotations: @NotNull/@Nullable on public API, @Internal/@Exp…
OhACD Dec 24, 2025
f5d9e3c
Docs: add @since tags to experimental API methods; add API javadoc ge…
OhACD Dec 24, 2025
a1fd9c3
Docs: add @since tags to experimental API methods; add API javadoc ge…
OhACD Dec 24, 2025
033b3c9
Merge pull request #21 from OhACD/docs/javadoc
OhACD Dec 24, 2025
e838d3d
docs(api): publish generated API Javadoc to gh-pages
OhACD Dec 24, 2025
e0b74e9
docs(site): add 'Unreleased docs' banner and root redirect to API ove…
OhACD Dec 24, 2025
b2abdeb
Init gh-pages branch
OhACD Dec 24, 2025
dd7c3e2
final docs
OhACD Dec 24, 2025
4fae1c5
Merge pull request #22 from OhACD/docs/javadoc
OhACD Dec 25, 2025
e92806d
Project cleanup and 0.9.5 finalization
OhACD Dec 25, 2025
8672500
Merge docs/javadoc into dev: resolve README conflict (keep concise in…
OhACD Dec 25, 2025
931f887
docs(wiki): remove paste headers from wiki pages
OhACD Dec 25, 2025
4af6ad6
chore: ignore local wiki clone (wiki-temp)
OhACD Dec 25, 2025
1609c30
chore: remove embedded wiki-temp from repo
OhACD Dec 25, 2025
7f990eb
Bug Fixes: Fixed Decorated Pots breaking when hit by an arrow during …
OhACD Dec 25, 2025
dcb2067
0.9.5 finalized: Fixed pot breaking bug
OhACD Dec 25, 2025
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
286 changes: 286 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
name: CI/CD Pipeline

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
java-version: [17, 21]

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

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

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

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Run unit tests
run: ./gradlew test --info

- name: Run integration tests
run: ./gradlew test --tests "*IntegrationTest*"

- name: Run performance tests
run: ./gradlew test --tests "*StressTest*" --info
continue-on-error: true # Performance tests may have timing variations

- name: Generate test report
run: ./gradlew test jacocoTestReport
if: always()

- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-java-${{ matrix.java-version }}
path: |
build/reports/tests/
build/reports/jacoco/
build/test-results/
build/reports/performance/

- name: Check test coverage
run: |
# Extract coverage percentage from JaCoCo report
COVERAGE=$(grep -oP 'Total.*?instruction.*?>\K\d+(?:\.\d+)?' build/reports/jacoco/test/html/index.html | head -1)
echo "Test coverage: $COVERAGE%"

# Fail if coverage is below 80%
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
echo "❌ Test coverage too low: $COVERAGE% (minimum: 80%)"
exit 1
else
echo "✅ Test coverage acceptable: $COVERAGE%"
fi

performance-analysis:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'

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

- name: Download performance reports
uses: actions/download-artifact@v3
with:
name: test-results-java-17
path: build/reports/

- name: Analyze performance metrics
run: |
echo "📊 Performance Analysis Report"
echo "================================"

# Check if performance reports exist
if [ -d "build/reports/performance" ]; then
echo "✅ Performance reports found"
ls -la build/reports/performance/

# Analyze latest performance report
LATEST_REPORT=$(find build/reports/performance -name "*.txt" -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
if [ -n "$LATEST_REPORT" ]; then
echo "📈 Latest Performance Report: $LATEST_REPORT"
echo "---"
cat "$LATEST_REPORT"
echo "---"

# Check for performance issues
if grep -q "❌ Poor" "$LATEST_REPORT"; then
echo "🚨 CRITICAL: Performance regression detected!"
exit 1
elif grep -q "⚠️" "$LATEST_REPORT"; then
echo "⚠️ WARNING: Performance issues detected"
else
echo "✅ Performance within acceptable limits"
fi
fi
else
echo "⚠️ No performance reports found - running basic performance test"

# Run a quick performance test if no reports exist
./gradlew test --tests "SessionStressTest.shouldHandleTenConcurrentSessions" --quiet
fi

build:
runs-on: ubuntu-latest
needs: [test, performance-analysis]

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

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

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

- name: Build plugin JAR
run: ./gradlew build -x test # Skip tests since we already ran them

- name: Verify JAR contents
run: |
echo "📦 Plugin JAR contents:"
java -jar build/libs/Matchbox-*.jar --version 2>/dev/null || echo "JAR created successfully"

echo "📊 JAR file details:"
ls -la build/libs/

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: matchbox-plugin
path: build/libs/Matchbox-*.jar

release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

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

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: matchbox-plugin
path: build/libs/

- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Matchbox v${{ github.run_number }}
body: |
## 🚀 Automated Release

This release has been automatically built and tested.

### ✅ Quality Assurance
- All unit tests passed
- Integration tests completed
- Performance tests validated
- Code coverage requirements met

### 📦 Assets
- Plugin JAR file attached

### 🔗 Links
- [Full Changelog](CHANGELOG.md)
- [API Documentation](MatchboxAPI_Docs.md)
draft: false
prerelease: false

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/libs/Matchbox-*.jar
asset_name: Matchbox-${{ github.run_number }}.jar
asset_content_type: application/java-archive

# Performance regression detection for PRs
performance-regression-check:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- name: Checkout base branch
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}

- name: Run baseline performance test
run: |
echo "📊 Running baseline performance test on ${{ github.base_ref }}"
./gradlew test --tests "SessionStressTest.shouldHandleTenConcurrentSessions" --quiet --info > baseline_performance.log 2>&1

# Extract key metrics from baseline
BASELINE_TIME=$(grep "Session.*created in" baseline_performance.log | grep -oP '\d+ ms' | awk '{sum+=$1} END {print sum/NR}')
echo "BASELINE_AVG_TIME=$BASELINE_TIME" >> $GITHUB_ENV

- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run PR performance test
run: |
echo "📊 Running PR performance test on ${{ github.head_ref }}"
./gradlew test --tests "SessionStressTest.shouldHandleTenConcurrentSessions" --quiet --info > pr_performance.log 2>&1

# Extract key metrics from PR
PR_TIME=$(grep "Session.*created in" pr_performance.log | grep -oP '\d+ ms' | awk '{sum+=$1} END {print sum/NR}')
echo "PR_AVG_TIME=$PR_TIME" >> $GITHUB_ENV

- name: Compare performance
run: |
echo "📈 Performance Comparison"
echo "========================"
echo "Baseline (${{ github.base_ref }}): ${{ env.BASELINE_AVG_TIME }}ms average"
echo "PR (${{ github.head_ref }}): ${{ env.PR_AVG_TIME }}ms average"

# Calculate performance change
if [ -n "${{ env.BASELINE_AVG_TIME }}" ] && [ -n "${{ env.PR_AVG_TIME }}" ]; then
BASELINE="${{ env.BASELINE_AVG_TIME }}"
PR="${{ env.PR_AVG_TIME }}"

# Calculate percentage change
if (( $(echo "$BASELINE > 0" | bc -l) )); then
CHANGE=$(echo "scale=2; (($PR - $BASELINE) / $BASELINE) * 100" | bc -l)
echo "Performance change: ${CHANGE}%"

# Check for significant regression
if (( $(echo "$CHANGE > 25" | bc -l) )); then
echo "🚨 SIGNIFICANT PERFORMANCE REGRESSION: +${CHANGE}% slower"
echo "This PR introduces a performance regression that should be addressed."
exit 1
elif (( $(echo "$CHANGE < -10" | bc -l) )); then
echo "✅ PERFORMANCE IMPROVEMENT: ${CHANGE}% faster"
else
echo "✅ Performance change within acceptable range: ${CHANGE}%"
fi
fi
else
echo "⚠️ Could not calculate performance change - missing metrics"
fi
29 changes: 29 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish Javadoc

on:
push:
branches: [ main, master, dev ]
pull_request:
branches: [ main, master, dev ]

jobs:
build-javadoc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Build Javadoc
run: ./gradlew.bat javadoc javadocJar --no-daemon

- name: Upload Javadoc artifact
uses: actions/upload-artifact@v4
with:
name: javadoc
path: build/libs/*-javadoc.jar
46 changes: 46 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Javadoc to GitHub Pages

on:
push:
branches: [ main, master, dev ]
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

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

- name: Build Javadoc
run: ./gradlew javadoc --no-daemon --console=plain

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./build/docs/javadoc
publish_branch: gh-pages
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
commit_message: 'chore(docs): update javadoc'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file modified .gitignore
Binary file not shown.
Loading
Loading