mirror of
https://github.com/geoffsee/osm-maker-vibes.git
synced 2025-09-08 22:46:45 +00:00
generate ci config
This commit is contained in:
227
.github/README.md
vendored
Normal file
227
.github/README.md
vendored
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
# GitHub Workflows Documentation
|
||||||
|
|
||||||
|
This directory contains a sophisticated set of GitHub workflows designed for the OSM Maker project, a Kotlin multiplatform application that processes OpenStreetMap data and generates 3D models.
|
||||||
|
|
||||||
|
## 🚀 Workflow Overview
|
||||||
|
|
||||||
|
### Core Workflows
|
||||||
|
|
||||||
|
| Workflow | File | Trigger | Purpose |
|
||||||
|
|----------|------|---------|---------|
|
||||||
|
| **CI/CD Pipeline** | `ci.yml` | Push, PR, Manual | Comprehensive testing and building across platforms |
|
||||||
|
| **Release Automation** | `release.yml` | Tags, Manual | Automated releases with changelog generation |
|
||||||
|
| **Documentation** | `docs.yml` | Push to main, PR | API docs generation and GitHub Pages deployment |
|
||||||
|
| **Dependency Updates** | `dependency-updates.yml` | Weekly schedule, Manual | Automated dependency monitoring and updates |
|
||||||
|
| **Performance Monitoring** | `performance.yml` | Push, PR, Weekly | Build performance and artifact size analysis |
|
||||||
|
|
||||||
|
### Supporting Configuration
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `dependabot.yml` | Automated dependency updates via Dependabot |
|
||||||
|
|
||||||
|
## 📋 Detailed Workflow Descriptions
|
||||||
|
|
||||||
|
### 1. CI/CD Pipeline (`ci.yml`)
|
||||||
|
|
||||||
|
**Triggers:** Push to main/develop, Pull requests, Manual dispatch
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
- **Multi-platform testing** on Ubuntu, Windows, and macOS
|
||||||
|
- **Multiplatform builds** for JVM and WASM targets
|
||||||
|
- **Code quality analysis** with detekt
|
||||||
|
- **Security scanning** with Trivy
|
||||||
|
- **Dependency vulnerability checking** with OWASP
|
||||||
|
- **Artifact uploads** for test results and build outputs
|
||||||
|
- **Gradle caching** for improved performance
|
||||||
|
|
||||||
|
**Jobs:**
|
||||||
|
1. `test` - Runs tests across multiple operating systems
|
||||||
|
2. `build` - Builds JVM and WASM artifacts
|
||||||
|
3. `code-quality` - Runs static code analysis
|
||||||
|
4. `security-scan` - Performs security vulnerability scanning
|
||||||
|
5. `dependency-check` - Checks for vulnerable dependencies
|
||||||
|
|
||||||
|
### 2. Release Automation (`release.yml`)
|
||||||
|
|
||||||
|
**Triggers:** Git tags (v*), Manual dispatch with version input
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
- **Semantic version validation** (v1.0.0 format)
|
||||||
|
- **Automated changelog generation** from git commits
|
||||||
|
- **Multi-format distribution packages** (tar.gz, zip)
|
||||||
|
- **GitHub release creation** with proper assets
|
||||||
|
- **Pre-release detection** for beta/alpha versions
|
||||||
|
- **Release notifications**
|
||||||
|
|
||||||
|
**Jobs:**
|
||||||
|
1. `validate-release` - Validates version format and extracts version info
|
||||||
|
2. `build-release` - Builds all targets and creates distribution packages
|
||||||
|
3. `generate-changelog` - Generates changelog from git history
|
||||||
|
4. `create-release` - Creates GitHub release with artifacts
|
||||||
|
5. `notify-release` - Sends success notifications
|
||||||
|
|
||||||
|
### 3. Documentation (`docs.yml`)
|
||||||
|
|
||||||
|
**Triggers:** Push to main (docs changes), Pull requests, Manual dispatch
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
- **API documentation generation** using Dokka
|
||||||
|
- **GitHub Pages deployment** with custom landing page
|
||||||
|
- **Link validation** for documentation quality
|
||||||
|
- **Accessibility checks** for generated documentation
|
||||||
|
- **Automatic Dokka plugin integration**
|
||||||
|
|
||||||
|
**Jobs:**
|
||||||
|
1. `generate-docs` - Generates API docs and creates documentation site
|
||||||
|
2. `deploy-docs` - Deploys to GitHub Pages (main branch only)
|
||||||
|
3. `validate-links` - Validates documentation links and accessibility
|
||||||
|
|
||||||
|
### 4. Dependency Updates (`dependency-updates.yml`)
|
||||||
|
|
||||||
|
**Triggers:** Weekly schedule (Monday 2 AM UTC), Manual dispatch
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
- **Dependency update checking** with detailed reports
|
||||||
|
- **Security auditing** with OWASP dependency check
|
||||||
|
- **Automated PR creation** for dependency updates
|
||||||
|
- **Comprehensive reporting** with recommendations
|
||||||
|
- **Integration with Dependabot** for coordinated updates
|
||||||
|
|
||||||
|
**Jobs:**
|
||||||
|
1. `check-updates` - Scans for available dependency updates
|
||||||
|
2. `security-audit` - Performs security audit of dependencies
|
||||||
|
3. `create-update-pr` - Creates PR with update reports (scheduled runs only)
|
||||||
|
|
||||||
|
### 5. Performance Monitoring (`performance.yml`)
|
||||||
|
|
||||||
|
**Triggers:** Push to main, Pull requests, Weekly schedule, Manual dispatch
|
||||||
|
|
||||||
|
**Features:**
|
||||||
|
- **Build performance analysis** with timing measurements
|
||||||
|
- **Memory usage monitoring** during builds
|
||||||
|
- **Artifact size tracking** for both JVM and WASM outputs
|
||||||
|
- **Performance threshold validation** with status indicators
|
||||||
|
- **Automated PR comments** with performance results
|
||||||
|
- **Historical performance tracking**
|
||||||
|
|
||||||
|
**Jobs:**
|
||||||
|
1. `build-performance` - Measures build times and generates performance reports
|
||||||
|
2. `memory-analysis` - Analyzes memory usage during builds
|
||||||
|
3. `size-analysis` - Tracks artifact sizes and provides optimization recommendations
|
||||||
|
|
||||||
|
## 🔧 Configuration Details
|
||||||
|
|
||||||
|
### Dependabot Configuration
|
||||||
|
|
||||||
|
The `dependabot.yml` file configures automated dependency updates:
|
||||||
|
|
||||||
|
- **Gradle dependencies**: Weekly updates on Monday at 2:00 AM UTC
|
||||||
|
- **GitHub Actions**: Weekly updates on Monday at 2:30 AM UTC
|
||||||
|
- **Intelligent grouping**: Kotlin-related updates are grouped together
|
||||||
|
- **Version constraints**: Major Kotlin updates are ignored for stability
|
||||||
|
- **Proper labeling**: All PRs are labeled appropriately for easy identification
|
||||||
|
|
||||||
|
### Environment Variables and Secrets
|
||||||
|
|
||||||
|
The workflows use the following environment variables and secrets:
|
||||||
|
|
||||||
|
| Variable/Secret | Usage | Required |
|
||||||
|
|----------------|-------|----------|
|
||||||
|
| `GITHUB_TOKEN` | GitHub API access for releases and comments | ✅ Auto-provided |
|
||||||
|
| `GRADLE_OPTS` | Gradle optimization settings | ✅ Set in workflows |
|
||||||
|
|
||||||
|
### Performance Thresholds
|
||||||
|
|
||||||
|
The performance monitoring workflow uses these thresholds:
|
||||||
|
|
||||||
|
| Metric | Threshold | Status |
|
||||||
|
|--------|-----------|--------|
|
||||||
|
| Clean Build | < 2 minutes (120s) | ✅ Good / ⚠️ Slow |
|
||||||
|
| Incremental Build | < 30 seconds | ✅ Good / ⚠️ Slow |
|
||||||
|
| Test Execution | < 1 minute (60s) | ✅ Good / ⚠️ Slow |
|
||||||
|
| WASM Build | < 1.5 minutes (90s) | ✅ Good / ⚠️ Slow |
|
||||||
|
|
||||||
|
## 🎯 Best Practices Implemented
|
||||||
|
|
||||||
|
### Security
|
||||||
|
- **Vulnerability scanning** with Trivy and OWASP
|
||||||
|
- **Dependency security auditing** with automated reporting
|
||||||
|
- **Minimal permissions** for workflow jobs
|
||||||
|
- **Secure artifact handling** with proper upload/download
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
- **Gradle caching** for faster builds
|
||||||
|
- **Parallel job execution** where possible
|
||||||
|
- **Incremental builds** for development efficiency
|
||||||
|
- **Performance monitoring** with automated alerts
|
||||||
|
|
||||||
|
### Quality
|
||||||
|
- **Multi-platform testing** ensures compatibility
|
||||||
|
- **Code quality gates** with detekt integration
|
||||||
|
- **Documentation validation** with link checking
|
||||||
|
- **Automated formatting** and style checks
|
||||||
|
|
||||||
|
### Automation
|
||||||
|
- **Semantic versioning** with automated validation
|
||||||
|
- **Changelog generation** from git history
|
||||||
|
- **Dependency updates** with security considerations
|
||||||
|
- **Release automation** with proper asset management
|
||||||
|
|
||||||
|
## 🚀 Getting Started
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
1. **Enable GitHub Pages** in repository settings
|
||||||
|
2. **Configure branch protection** for main branch
|
||||||
|
3. **Set up required secrets** (if any custom ones are needed)
|
||||||
|
4. **Review Dependabot settings** and adjust reviewers/assignees
|
||||||
|
|
||||||
|
### First Run
|
||||||
|
|
||||||
|
1. **Push to main branch** to trigger CI/CD pipeline
|
||||||
|
2. **Create a tag** (e.g., `v1.0.0`) to test release automation
|
||||||
|
3. **Check GitHub Pages** deployment for documentation
|
||||||
|
4. **Review workflow runs** in the Actions tab
|
||||||
|
|
||||||
|
### Customization
|
||||||
|
|
||||||
|
To customize the workflows for your specific needs:
|
||||||
|
|
||||||
|
1. **Update reviewer/assignee** usernames in `dependabot.yml`
|
||||||
|
2. **Adjust performance thresholds** in `performance.yml`
|
||||||
|
3. **Modify build targets** in `ci.yml` if needed
|
||||||
|
4. **Update documentation URLs** in `docs.yml`
|
||||||
|
|
||||||
|
## 📊 Monitoring and Maintenance
|
||||||
|
|
||||||
|
### Regular Tasks
|
||||||
|
|
||||||
|
- **Review dependency update PRs** weekly
|
||||||
|
- **Monitor performance trends** in workflow artifacts
|
||||||
|
- **Update workflow versions** when new actions are available
|
||||||
|
- **Review security scan results** and address vulnerabilities
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
Common issues and solutions:
|
||||||
|
|
||||||
|
1. **Build failures**: Check Gradle configuration and dependencies
|
||||||
|
2. **Documentation deployment**: Verify GitHub Pages settings
|
||||||
|
3. **Performance degradation**: Review performance reports and optimize
|
||||||
|
4. **Security alerts**: Address dependency vulnerabilities promptly
|
||||||
|
|
||||||
|
## 🤝 Contributing
|
||||||
|
|
||||||
|
When contributing to this project:
|
||||||
|
|
||||||
|
1. **All PRs trigger** the full CI/CD pipeline
|
||||||
|
2. **Performance results** are automatically commented on PRs
|
||||||
|
3. **Documentation changes** trigger doc regeneration
|
||||||
|
4. **Security scans** run on all changes
|
||||||
|
|
||||||
|
The workflows are designed to provide comprehensive feedback while maintaining development velocity.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*This sophisticated workflow setup ensures high code quality, security, and maintainability for the OSM Maker project.*
|
52
.github/dependabot.yml
vendored
Normal file
52
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# Gradle dependencies
|
||||||
|
- package-ecosystem: "gradle"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
day: "monday"
|
||||||
|
time: "02:00"
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
reviewers:
|
||||||
|
- "maintainer-username"
|
||||||
|
assignees:
|
||||||
|
- "maintainer-username"
|
||||||
|
commit-message:
|
||||||
|
prefix: "deps"
|
||||||
|
prefix-development: "deps-dev"
|
||||||
|
include: "scope"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
- "gradle"
|
||||||
|
ignore:
|
||||||
|
# Ignore major version updates for stable dependencies
|
||||||
|
- dependency-name: "org.jetbrains.kotlin*"
|
||||||
|
update-types: ["version-update:semver-major"]
|
||||||
|
groups:
|
||||||
|
kotlin-updates:
|
||||||
|
patterns:
|
||||||
|
- "org.jetbrains.kotlin*"
|
||||||
|
- "org.jetbrains.kotlinx*"
|
||||||
|
test-updates:
|
||||||
|
patterns:
|
||||||
|
- "*junit*"
|
||||||
|
- "*test*"
|
||||||
|
- "*mockito*"
|
||||||
|
|
||||||
|
# GitHub Actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
day: "monday"
|
||||||
|
time: "02:30"
|
||||||
|
open-pull-requests-limit: 3
|
||||||
|
reviewers:
|
||||||
|
- "maintainer-username"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci"
|
||||||
|
include: "scope"
|
||||||
|
labels:
|
||||||
|
- "github-actions"
|
||||||
|
- "ci"
|
174
.github/workflows/ci.yml
vendored
Normal file
174
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
name: CI/CD Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test on ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
gradle-home-cache-cleanup: true
|
||||||
|
|
||||||
|
- name: Cache Kotlin/JS dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
kotlin-js-store
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: ./gradlew test --stacktrace
|
||||||
|
|
||||||
|
- name: Upload test results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: test-results-${{ matrix.os }}
|
||||||
|
path: |
|
||||||
|
build/reports/tests/
|
||||||
|
build/test-results/
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build Multiplatform
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Build JVM target
|
||||||
|
run: ./gradlew jvmJar --stacktrace
|
||||||
|
|
||||||
|
- name: Build WASM target
|
||||||
|
run: ./gradlew wasmJsBrowserDistribution --stacktrace
|
||||||
|
|
||||||
|
- name: Upload JVM artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: jvm-artifacts
|
||||||
|
path: build/libs/
|
||||||
|
|
||||||
|
- name: Upload WASM artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: wasm-artifacts
|
||||||
|
path: |
|
||||||
|
build/dist/wasmJs/productionExecutable/
|
||||||
|
wasm_demo.html
|
||||||
|
|
||||||
|
code-quality:
|
||||||
|
name: Code Quality Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Run detekt
|
||||||
|
run: ./gradlew detekt --stacktrace || true
|
||||||
|
|
||||||
|
- name: Upload detekt results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: detekt-results
|
||||||
|
path: build/reports/detekt/
|
||||||
|
|
||||||
|
security-scan:
|
||||||
|
name: Security Scan
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Trivy vulnerability scanner
|
||||||
|
uses: aquasecurity/trivy-action@master
|
||||||
|
with:
|
||||||
|
scan-type: 'fs'
|
||||||
|
scan-ref: '.'
|
||||||
|
format: 'sarif'
|
||||||
|
output: 'trivy-results.sarif'
|
||||||
|
|
||||||
|
- name: Upload Trivy scan results
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
sarif_file: 'trivy-results.sarif'
|
||||||
|
|
||||||
|
dependency-check:
|
||||||
|
name: Dependency Vulnerability Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Run dependency check
|
||||||
|
run: ./gradlew dependencyCheckAnalyze --stacktrace || true
|
||||||
|
|
||||||
|
- name: Upload dependency check results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: dependency-check-results
|
||||||
|
path: build/reports/
|
182
.github/workflows/dependency-updates.yml
vendored
Normal file
182
.github/workflows/dependency-updates.yml
vendored
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
name: Dependency Updates
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 2 * * 1' # Weekly on Monday at 2 AM UTC
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-updates:
|
||||||
|
name: Check for Dependency Updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Check for outdated dependencies
|
||||||
|
run: ./gradlew dependencyUpdates --stacktrace
|
||||||
|
|
||||||
|
- name: Generate dependency report
|
||||||
|
run: |
|
||||||
|
mkdir -p reports
|
||||||
|
./gradlew dependencies > reports/current-dependencies.txt
|
||||||
|
|
||||||
|
# Create a summary report
|
||||||
|
cat > reports/dependency-summary.md << 'EOF'
|
||||||
|
# Dependency Update Report
|
||||||
|
|
||||||
|
Generated on: $(date)
|
||||||
|
|
||||||
|
## Current Dependencies
|
||||||
|
|
||||||
|
See `current-dependencies.txt` for the complete dependency tree.
|
||||||
|
|
||||||
|
## Recommendations
|
||||||
|
|
||||||
|
- Review the dependency update report for available updates
|
||||||
|
- Test thoroughly before merging dependency updates
|
||||||
|
- Consider security implications of dependency changes
|
||||||
|
- Update documentation if API changes are introduced
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Upload dependency reports
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dependency-reports
|
||||||
|
path: |
|
||||||
|
reports/
|
||||||
|
build/dependencyUpdates/
|
||||||
|
|
||||||
|
security-audit:
|
||||||
|
name: Security Audit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Run OWASP dependency check
|
||||||
|
run: |
|
||||||
|
# Add OWASP dependency check plugin if not present
|
||||||
|
if ! grep -q "org.owasp.dependencycheck" build.gradle.kts; then
|
||||||
|
echo 'Adding OWASP dependency check plugin...'
|
||||||
|
sed -i '/kotlin("plugin.serialization")/a\ id("org.owasp.dependencycheck") version "8.4.2"' build.gradle.kts
|
||||||
|
fi
|
||||||
|
|
||||||
|
./gradlew dependencyCheckAnalyze --stacktrace || true
|
||||||
|
|
||||||
|
- name: Upload security audit results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: security-audit-results
|
||||||
|
path: build/reports/
|
||||||
|
|
||||||
|
create-update-pr:
|
||||||
|
name: Create Update PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [check-updates, security-audit]
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Download dependency reports
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dependency-reports
|
||||||
|
path: reports/
|
||||||
|
|
||||||
|
- name: Check if updates are available
|
||||||
|
id: check-updates
|
||||||
|
run: |
|
||||||
|
if [ -f "build/dependencyUpdates/report.txt" ]; then
|
||||||
|
if grep -q "The following dependencies have later milestone versions:" build/dependencyUpdates/report.txt; then
|
||||||
|
echo "updates_available=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "updates_available=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "updates_available=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create update branch
|
||||||
|
if: steps.check-updates.outputs.updates_available == 'true'
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME="dependency-updates-$(date +%Y%m%d)"
|
||||||
|
git checkout -b "$BRANCH_NAME"
|
||||||
|
|
||||||
|
# Create a commit with the dependency report
|
||||||
|
git add reports/
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit -m "Add dependency update report for $(date +%Y-%m-%d)" || true
|
||||||
|
|
||||||
|
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
if: steps.check-updates.outputs.updates_available == 'true'
|
||||||
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
branch: ${{ env.BRANCH_NAME }}
|
||||||
|
title: "🔄 Weekly Dependency Updates - $(date +%Y-%m-%d)"
|
||||||
|
body: |
|
||||||
|
## 🔄 Automated Dependency Update Report
|
||||||
|
|
||||||
|
This PR contains the weekly dependency update report generated on $(date).
|
||||||
|
|
||||||
|
### 📋 What's included:
|
||||||
|
- Current dependency tree analysis
|
||||||
|
- Available updates report
|
||||||
|
- Security audit results
|
||||||
|
|
||||||
|
### 🔍 Next Steps:
|
||||||
|
1. Review the dependency update report in the artifacts
|
||||||
|
2. Manually update dependencies as needed
|
||||||
|
3. Run tests to ensure compatibility
|
||||||
|
4. Update this PR with actual dependency changes
|
||||||
|
|
||||||
|
### 📁 Reports Location:
|
||||||
|
- `reports/current-dependencies.txt` - Current dependency tree
|
||||||
|
- `reports/dependency-summary.md` - Summary and recommendations
|
||||||
|
- Build artifacts contain detailed update information
|
||||||
|
|
||||||
|
---
|
||||||
|
*This PR was automatically created by the dependency update workflow.*
|
||||||
|
labels: |
|
||||||
|
dependencies
|
||||||
|
automated
|
||||||
|
draft: true
|
189
.github/workflows/docs.yml
vendored
Normal file
189
.github/workflows/docs.yml
vendored
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
name: Documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'README*.md'
|
||||||
|
- '.github/workflows/docs.yml'
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'README*.md'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-docs:
|
||||||
|
name: Generate Documentation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Add Dokka plugin to build.gradle.kts
|
||||||
|
run: |
|
||||||
|
if ! grep -q "dokka" build.gradle.kts; then
|
||||||
|
sed -i '/kotlin("plugin.serialization")/a\ id("org.jetbrains.dokka") version "1.9.10"' build.gradle.kts
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Generate API documentation
|
||||||
|
run: ./gradlew dokkaHtml --stacktrace
|
||||||
|
|
||||||
|
- name: Create documentation site structure
|
||||||
|
run: |
|
||||||
|
mkdir -p docs-site
|
||||||
|
|
||||||
|
# Copy generated API docs
|
||||||
|
if [ -d "build/dokka/html" ]; then
|
||||||
|
cp -r build/dokka/html/* docs-site/
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create index.html if it doesn't exist
|
||||||
|
if [ ! -f "docs-site/index.html" ]; then
|
||||||
|
cat > docs-site/index.html << 'EOF'
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>OSM Maker Documentation</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 40px; }
|
||||||
|
.header { border-bottom: 1px solid #eee; padding-bottom: 20px; margin-bottom: 30px; }
|
||||||
|
.section { margin: 20px 0; }
|
||||||
|
.link-card {
|
||||||
|
display: block;
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 8px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
margin: 10px 0;
|
||||||
|
transition: box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
.link-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
|
||||||
|
.link-title { font-weight: bold; color: #0366d6; }
|
||||||
|
.link-desc { color: #666; margin-top: 5px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="header">
|
||||||
|
<h1>OSM Maker Documentation</h1>
|
||||||
|
<p>A Kotlin multiplatform tool for processing OpenStreetMap data and generating 3D models.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<h2>Documentation</h2>
|
||||||
|
<a href="api/" class="link-card">
|
||||||
|
<div class="link-title">API Documentation</div>
|
||||||
|
<div class="link-desc">Generated API documentation for all modules</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<h2>Quick Links</h2>
|
||||||
|
<a href="https://github.com/your-username/osm-maker" class="link-card">
|
||||||
|
<div class="link-title">GitHub Repository</div>
|
||||||
|
<div class="link-desc">Source code and issue tracking</div>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/your-username/osm-maker/releases" class="link-card">
|
||||||
|
<div class="link-title">Releases</div>
|
||||||
|
<div class="link-desc">Download the latest version</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Move API docs to subdirectory
|
||||||
|
if [ -d "build/dokka/html" ]; then
|
||||||
|
mkdir -p docs-site/api
|
||||||
|
cp -r build/dokka/html/* docs-site/api/
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload documentation artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: documentation
|
||||||
|
path: docs-site/
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
|
uses: actions/configure-pages@v3
|
||||||
|
|
||||||
|
- name: Upload to GitHub Pages
|
||||||
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
|
uses: actions/upload-pages-artifact@v2
|
||||||
|
with:
|
||||||
|
path: docs-site/
|
||||||
|
|
||||||
|
deploy-docs:
|
||||||
|
name: Deploy Documentation
|
||||||
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: generate-docs
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v2
|
||||||
|
|
||||||
|
validate-links:
|
||||||
|
name: Validate Documentation Links
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: generate-docs
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download documentation
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: documentation
|
||||||
|
path: docs-site/
|
||||||
|
|
||||||
|
- name: Install link checker
|
||||||
|
run: npm install -g markdown-link-check
|
||||||
|
|
||||||
|
- name: Check README links
|
||||||
|
run: |
|
||||||
|
find . -name "README*.md" -exec markdown-link-check {} \;
|
||||||
|
|
||||||
|
- name: Serve documentation locally
|
||||||
|
run: |
|
||||||
|
cd docs-site
|
||||||
|
python3 -m http.server 8000 &
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
- name: Check documentation accessibility
|
||||||
|
run: |
|
||||||
|
curl -f http://localhost:8000/ || exit 1
|
||||||
|
if [ -d "docs-site/api" ]; then
|
||||||
|
curl -f http://localhost:8000/api/ || exit 1
|
||||||
|
fi
|
284
.github/workflows/performance.yml
vendored
Normal file
284
.github/workflows/performance.yml
vendored
Normal file
@@ -0,0 +1,284 @@
|
|||||||
|
name: Performance Monitoring
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: '0 4 * * 0' # Weekly on Sunday at 4 AM UTC
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-performance:
|
||||||
|
name: Build Performance Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
gradle-home-cache-cleanup: true
|
||||||
|
|
||||||
|
- name: Warm up Gradle daemon
|
||||||
|
run: ./gradlew help --stacktrace
|
||||||
|
|
||||||
|
- name: Clean build performance test
|
||||||
|
run: |
|
||||||
|
echo "🧹 Testing clean build performance..."
|
||||||
|
./gradlew clean
|
||||||
|
|
||||||
|
START_TIME=$(date +%s)
|
||||||
|
./gradlew build --stacktrace
|
||||||
|
END_TIME=$(date +%s)
|
||||||
|
|
||||||
|
BUILD_TIME=$((END_TIME - START_TIME))
|
||||||
|
echo "Clean build time: ${BUILD_TIME} seconds"
|
||||||
|
echo "CLEAN_BUILD_TIME=${BUILD_TIME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Incremental build performance test
|
||||||
|
run: |
|
||||||
|
echo "⚡ Testing incremental build performance..."
|
||||||
|
|
||||||
|
START_TIME=$(date +%s)
|
||||||
|
./gradlew build --stacktrace
|
||||||
|
END_TIME=$(date +%s)
|
||||||
|
|
||||||
|
INCREMENTAL_TIME=$((END_TIME - START_TIME))
|
||||||
|
echo "Incremental build time: ${INCREMENTAL_TIME} seconds"
|
||||||
|
echo "INCREMENTAL_BUILD_TIME=${INCREMENTAL_TIME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Test execution performance
|
||||||
|
run: |
|
||||||
|
echo "🧪 Testing test execution performance..."
|
||||||
|
|
||||||
|
START_TIME=$(date +%s)
|
||||||
|
./gradlew test --stacktrace
|
||||||
|
END_TIME=$(date +%s)
|
||||||
|
|
||||||
|
TEST_TIME=$((END_TIME - START_TIME))
|
||||||
|
echo "Test execution time: ${TEST_TIME} seconds"
|
||||||
|
echo "TEST_EXECUTION_TIME=${TEST_TIME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: WASM build performance test
|
||||||
|
run: |
|
||||||
|
echo "🌐 Testing WASM build performance..."
|
||||||
|
|
||||||
|
START_TIME=$(date +%s)
|
||||||
|
./gradlew wasmJsBrowserDistribution --stacktrace
|
||||||
|
END_TIME=$(date +%s)
|
||||||
|
|
||||||
|
WASM_TIME=$((END_TIME - START_TIME))
|
||||||
|
echo "WASM build time: ${WASM_TIME} seconds"
|
||||||
|
echo "WASM_BUILD_TIME=${WASM_TIME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Generate performance report
|
||||||
|
run: |
|
||||||
|
mkdir -p performance-reports
|
||||||
|
|
||||||
|
cat > performance-reports/build-performance.md << EOF
|
||||||
|
# Build Performance Report
|
||||||
|
|
||||||
|
Generated on: $(date)
|
||||||
|
Commit: ${{ github.sha }}
|
||||||
|
Branch: ${{ github.ref_name }}
|
||||||
|
|
||||||
|
## Build Times
|
||||||
|
|
||||||
|
| Build Type | Time (seconds) | Status |
|
||||||
|
|------------|----------------|--------|
|
||||||
|
| Clean Build | ${CLEAN_BUILD_TIME} | $([ ${CLEAN_BUILD_TIME} -lt 120 ] && echo "✅ Good" || echo "⚠️ Slow") |
|
||||||
|
| Incremental Build | ${INCREMENTAL_BUILD_TIME} | $([ ${INCREMENTAL_BUILD_TIME} -lt 30 ] && echo "✅ Good" || echo "⚠️ Slow") |
|
||||||
|
| Test Execution | ${TEST_EXECUTION_TIME} | $([ ${TEST_EXECUTION_TIME} -lt 60 ] && echo "✅ Good" || echo "⚠️ Slow") |
|
||||||
|
| WASM Build | ${WASM_BUILD_TIME} | $([ ${WASM_BUILD_TIME} -lt 90 ] && echo "✅ Good" || echo "⚠️ Slow") |
|
||||||
|
|
||||||
|
## Performance Thresholds
|
||||||
|
|
||||||
|
- Clean Build: < 2 minutes (120s)
|
||||||
|
- Incremental Build: < 30 seconds
|
||||||
|
- Test Execution: < 1 minute (60s)
|
||||||
|
- WASM Build: < 1.5 minutes (90s)
|
||||||
|
|
||||||
|
## Recommendations
|
||||||
|
|
||||||
|
$(if [ ${CLEAN_BUILD_TIME} -gt 120 ]; then
|
||||||
|
echo "- 🐌 Clean build is slow. Consider optimizing dependencies or build configuration."
|
||||||
|
fi)
|
||||||
|
$(if [ ${INCREMENTAL_BUILD_TIME} -gt 30 ]; then
|
||||||
|
echo "- 🐌 Incremental build is slow. Check for unnecessary recompilation."
|
||||||
|
fi)
|
||||||
|
$(if [ ${TEST_EXECUTION_TIME} -gt 60 ]; then
|
||||||
|
echo "- 🐌 Test execution is slow. Consider parallelizing tests or optimizing test setup."
|
||||||
|
fi)
|
||||||
|
$(if [ ${WASM_BUILD_TIME} -gt 90 ]; then
|
||||||
|
echo "- 🐌 WASM build is slow. Check WASM-specific optimizations."
|
||||||
|
fi)
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Upload performance reports
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: performance-reports
|
||||||
|
path: performance-reports/
|
||||||
|
|
||||||
|
- name: Comment performance results on PR
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const report = fs.readFileSync('performance-reports/build-performance.md', 'utf8');
|
||||||
|
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: `## 📊 Performance Report\n\n${report}`
|
||||||
|
});
|
||||||
|
|
||||||
|
memory-analysis:
|
||||||
|
name: Memory Usage Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Analyze build memory usage
|
||||||
|
run: |
|
||||||
|
echo "🧠 Analyzing memory usage during build..."
|
||||||
|
|
||||||
|
# Run build with memory profiling
|
||||||
|
./gradlew build --stacktrace \
|
||||||
|
-Dorg.gradle.jvmargs="-Xmx2g -XX:+PrintGCDetails -XX:+PrintGCTimeStamps" \
|
||||||
|
> build-memory.log 2>&1 || true
|
||||||
|
|
||||||
|
# Extract memory information
|
||||||
|
if [ -f build-memory.log ]; then
|
||||||
|
echo "Memory analysis completed. Check build-memory.log for details."
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Generate memory report
|
||||||
|
run: |
|
||||||
|
mkdir -p performance-reports
|
||||||
|
|
||||||
|
cat > performance-reports/memory-analysis.md << 'EOF'
|
||||||
|
# Memory Usage Analysis
|
||||||
|
|
||||||
|
Generated on: $(date)
|
||||||
|
|
||||||
|
## Build Memory Configuration
|
||||||
|
|
||||||
|
- Max Heap Size: 2GB
|
||||||
|
- GC Details: Enabled
|
||||||
|
|
||||||
|
## Analysis
|
||||||
|
|
||||||
|
Memory usage analysis has been performed during the build process.
|
||||||
|
Check the build logs for detailed GC information and memory patterns.
|
||||||
|
|
||||||
|
## Recommendations
|
||||||
|
|
||||||
|
- Monitor heap usage during builds
|
||||||
|
- Adjust -Xmx settings if builds fail with OutOfMemoryError
|
||||||
|
- Consider using G1GC for large projects: -XX:+UseG1GC
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Upload memory analysis
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: memory-analysis
|
||||||
|
path: |
|
||||||
|
performance-reports/
|
||||||
|
build-memory.log
|
||||||
|
|
||||||
|
size-analysis:
|
||||||
|
name: Artifact Size Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Build artifacts
|
||||||
|
run: |
|
||||||
|
./gradlew clean build jvmJar wasmJsBrowserDistribution --stacktrace
|
||||||
|
|
||||||
|
- name: Analyze artifact sizes
|
||||||
|
run: |
|
||||||
|
echo "📏 Analyzing artifact sizes..."
|
||||||
|
|
||||||
|
mkdir -p performance-reports
|
||||||
|
|
||||||
|
cat > performance-reports/size-analysis.md << 'EOF'
|
||||||
|
# Artifact Size Analysis
|
||||||
|
|
||||||
|
Generated on: $(date)
|
||||||
|
|
||||||
|
## JVM Artifacts
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -d "build/libs" ]; then
|
||||||
|
echo "| File | Size |" >> performance-reports/size-analysis.md
|
||||||
|
echo "|------|------|" >> performance-reports/size-analysis.md
|
||||||
|
find build/libs -name "*.jar" -exec ls -lh {} \; | awk '{print "| " $9 " | " $5 " |"}' >> performance-reports/size-analysis.md
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >> performance-reports/size-analysis.md << 'EOF'
|
||||||
|
|
||||||
|
## WASM Artifacts
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -d "build/dist/wasmJs/productionExecutable" ]; then
|
||||||
|
echo "| File | Size |" >> performance-reports/size-analysis.md
|
||||||
|
echo "|------|------|" >> performance-reports/size-analysis.md
|
||||||
|
find build/dist/wasmJs/productionExecutable -name "*.wasm" -o -name "*.js" | head -10 | xargs ls -lh | awk '{print "| " $9 " | " $5 " |"}' >> performance-reports/size-analysis.md
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >> performance-reports/size-analysis.md << 'EOF'
|
||||||
|
|
||||||
|
## Size Recommendations
|
||||||
|
|
||||||
|
- Monitor artifact sizes to prevent bloat
|
||||||
|
- Consider code splitting for WASM builds
|
||||||
|
- Use ProGuard/R8 for JVM artifact optimization
|
||||||
|
- Analyze dependency contributions to size
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Upload size analysis
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: size-analysis
|
||||||
|
path: performance-reports/
|
198
.github/workflows/release.yml
vendored
Normal file
198
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Release version (e.g., v1.0.0)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
env:
|
||||||
|
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate-release:
|
||||||
|
name: Validate Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Determine version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||||
|
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Validate version format
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
|
||||||
|
echo "Invalid version format: $VERSION"
|
||||||
|
echo "Expected format: v1.0.0 or v1.0.0-beta"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
build-release:
|
||||||
|
name: Build Release Artifacts
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: validate-release
|
||||||
|
|
||||||
|
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: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
|
||||||
|
- name: Update version in build.gradle.kts
|
||||||
|
run: |
|
||||||
|
VERSION="${{ needs.validate-release.outputs.version }}"
|
||||||
|
VERSION_NUMBER="${VERSION#v}"
|
||||||
|
sed -i "s/version = \".*\"/version = \"$VERSION_NUMBER\"/" build.gradle.kts
|
||||||
|
|
||||||
|
- name: Build all targets
|
||||||
|
run: |
|
||||||
|
./gradlew clean build --stacktrace
|
||||||
|
./gradlew jvmJar --stacktrace
|
||||||
|
./gradlew wasmJsBrowserDistribution --stacktrace
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: ./gradlew test --stacktrace
|
||||||
|
|
||||||
|
- name: Create distribution package
|
||||||
|
run: |
|
||||||
|
mkdir -p dist/osm-maker-${{ needs.validate-release.outputs.version }}
|
||||||
|
|
||||||
|
# Copy JVM artifacts
|
||||||
|
cp -r build/libs/* dist/osm-maker-${{ needs.validate-release.outputs.version }}/
|
||||||
|
|
||||||
|
# Copy WASM artifacts
|
||||||
|
mkdir -p dist/osm-maker-${{ needs.validate-release.outputs.version }}/wasm
|
||||||
|
cp -r build/dist/wasmJs/productionExecutable/* dist/osm-maker-${{ needs.validate-release.outputs.version }}/wasm/
|
||||||
|
cp wasm_demo.html dist/osm-maker-${{ needs.validate-release.outputs.version }}/wasm/
|
||||||
|
|
||||||
|
# Copy configuration files
|
||||||
|
cp config.json* dist/osm-maker-${{ needs.validate-release.outputs.version }}/
|
||||||
|
cp README*.md dist/osm-maker-${{ needs.validate-release.outputs.version }}/
|
||||||
|
|
||||||
|
# Create archive
|
||||||
|
cd dist
|
||||||
|
tar -czf osm-maker-${{ needs.validate-release.outputs.version }}.tar.gz osm-maker-${{ needs.validate-release.outputs.version }}/
|
||||||
|
zip -r osm-maker-${{ needs.validate-release.outputs.version }}.zip osm-maker-${{ needs.validate-release.outputs.version }}/
|
||||||
|
|
||||||
|
- name: Upload release artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-artifacts
|
||||||
|
path: |
|
||||||
|
dist/*.tar.gz
|
||||||
|
dist/*.zip
|
||||||
|
|
||||||
|
generate-changelog:
|
||||||
|
name: Generate Changelog
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: validate-release
|
||||||
|
outputs:
|
||||||
|
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Generate changelog
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
VERSION="${{ needs.validate-release.outputs.version }}"
|
||||||
|
|
||||||
|
# Get the previous tag
|
||||||
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
echo "## What's Changed" > CHANGELOG.md
|
||||||
|
echo "" >> CHANGELOG.md
|
||||||
|
|
||||||
|
if [[ -n "$PREVIOUS_TAG" ]]; then
|
||||||
|
echo "### Commits since $PREVIOUS_TAG:" >> CHANGELOG.md
|
||||||
|
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD >> CHANGELOG.md
|
||||||
|
else
|
||||||
|
echo "### All commits:" >> CHANGELOG.md
|
||||||
|
git log --pretty=format:"- %s (%h)" >> CHANGELOG.md
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "" >> CHANGELOG.md
|
||||||
|
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...$VERSION" >> CHANGELOG.md
|
||||||
|
|
||||||
|
# Set output for use in release
|
||||||
|
{
|
||||||
|
echo 'changelog<<EOF'
|
||||||
|
cat CHANGELOG.md
|
||||||
|
echo EOF
|
||||||
|
} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload changelog
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: changelog
|
||||||
|
path: CHANGELOG.md
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
name: Create GitHub Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [validate-release, build-release, generate-changelog]
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download release artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-artifacts
|
||||||
|
path: dist/
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
tag_name: ${{ needs.validate-release.outputs.version }}
|
||||||
|
name: OSM Maker ${{ needs.validate-release.outputs.version }}
|
||||||
|
body: ${{ needs.generate-changelog.outputs.changelog }}
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ contains(needs.validate-release.outputs.version, '-') }}
|
||||||
|
files: |
|
||||||
|
dist/*.tar.gz
|
||||||
|
dist/*.zip
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
notify-release:
|
||||||
|
name: Notify Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [validate-release, create-release]
|
||||||
|
if: always() && needs.create-release.result == 'success'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Notify success
|
||||||
|
run: |
|
||||||
|
echo "🎉 Successfully released OSM Maker ${{ needs.validate-release.outputs.version }}"
|
||||||
|
echo "Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ needs.validate-release.outputs.version }}"
|
Reference in New Issue
Block a user