Skip to content

Latest commit

 

History

History
271 lines (209 loc) · 8.1 KB

WORKFLOWS.md

File metadata and controls

271 lines (209 loc) · 8.1 KB

📋 GitHub Workflows Documentation

🚀 Overview

This document details all GitHub workflows added to the Java Concurrency Patterns repository. These workflows provide comprehensive automation for dependency management, performance testing, quality assurance, and developer experience improvements.


🔄 GitHub Workflows Added

1. Dependency Update Workflow (dependency-update.yml)

Purpose: Automated dependency management and security vulnerability detection

Triggers:

  • 🕐 Schedule: Every Monday at 9 AM UTC
  • 🔧 Manual: workflow_dispatch

Jobs:

  1. update-dependencies

    • Checks for available dependency updates using Gradle
    • Generates dependency update report
    • Uploads report as artifact
    • Creates GitHub step summary with results
  2. security-audit

    • Runs OWASP dependency check for known vulnerabilities
    • Generates security audit report
    • Continues on error to avoid breaking builds
    • Uploads security report as artifact

Key Features:

  • Non-breaking: Uses continue-on-error: true
  • Artifact retention for historical tracking
  • Clear summaries in GitHub UI

2. Performance Benchmark Workflow (performance-benchmark.yml)

Purpose: Track performance metrics and compare different concurrency implementations

Triggers:

  • 🚀 Push: Main branch changes to src/ or build files
  • 🔀 Pull Request: Changes to src/ or build files
  • 🕐 Schedule: Every Sunday at 2 AM UTC
  • 🔧 Manual: With customizable benchmark duration

Jobs:

  1. benchmark

    • Creates and runs ConcurrencyBenchmark test
    • Compares Virtual Threads vs Platform Threads performance
    • Captures system information (CPU, memory, OS)
    • Memory usage analysis with GC details
    • 30-minute timeout for long-running benchmarks
    • Comments results on PRs automatically
  2. stress-test

    • Runs all tests with increased load (4GB heap)
    • 15-minute timeout
    • Analyzes pass/fail rates
    • Uploads stress test results

Key Features:

  • PR comments with benchmark results
  • System resource monitoring
  • Performance regression detection
  • Configurable benchmark duration via workflow_dispatch

3. Release Automation Workflow (release.yml)

Purpose: Fully automated release pipeline with validation and artifact generation

Triggers:

  • 🏷️ Tags: Version tags matching v*.*.* pattern
  • 🔧 Manual: With version, pre-release, and draft options

Jobs:

  1. validate-release

    • Validates version format (semantic versioning)
    • Auto-detects pre-release from version string (alpha/beta/rc)
    • Runs all tests
    • Executes quality checks
    • Generates test coverage
  2. build-artifacts

    • Updates version in build.gradle
    • Builds JAR files (main, sources, javadoc)
    • Creates distribution archives
    • Packages examples separately
    • Creates full source archive
  3. generate-release-notes

    • Auto-generates release notes from git history
    • Categorizes changes (Features, Bug Fixes, Docs, Technical)
    • Includes commit statistics
    • Links to full changelog
  4. create-release

    • Creates GitHub release with all artifacts
    • Uploads JAR files and archives
    • Supports draft and pre-release flags
    • Uses generated release notes
  5. post-release

    • Creates follow-up issue with post-release tasks
    • Suggests next development version

Key Features:

  • Semantic versioning validation
  • Automated changelog generation
  • Multiple artifact formats
  • Post-release automation

4. Documentation Generation Workflow (documentation.yml)

Purpose: Automated documentation generation and GitHub Pages deployment

Triggers:

  • 🚀 Push: Main branch changes to src/, docs/, or README
  • 🔀 Pull Request: Documentation-related changes
  • 🔧 Manual: workflow_dispatch

Jobs:

  1. generate-javadoc

    • Generates Javadoc with Gradle
    • Creates beautiful HTML documentation site
    • Includes pattern categorization
    • Copies test coverage reports
    • Deploys to GitHub Pages (main branch only)
    • Creates pattern-specific documentation
  2. validate-documentation

    • Checks for Javadoc errors/warnings
    • Calculates documentation coverage percentage
    • Lists files missing documentation
    • Comments results on PRs
  3. check-links

    • Validates all links in README.md
    • Checks internal file references
    • Verifies external URLs
    • Uploads link check results

Key Features:

  • GitHub Pages automatic deployment
  • Documentation coverage metrics
  • Link validation
  • PR feedback comments

5. Issue and PR Management Workflow (issue-management.yml)

Purpose: Intelligent issue/PR automation and contributor experience enhancement

Triggers:

  • 📋 Issues: opened, edited, labeled, unlabeled
  • 🔀 Pull Requests: opened, edited, labeled, ready_for_review
  • 💬 Comments: issue_comment created
  • 🕐 Schedule: Daily at 12 PM UTC for stale checks

Jobs:

  1. label-issues

    • Auto-labels based on title/content keywords
    • Detects: bug, enhancement, documentation, performance, etc.
    • Adds priority labels for urgent/critical issues
    • Welcome message for first-time contributors
  2. label-pull-requests

    • Auto-labels based on changes and PR content
    • Size labels (small/medium/large) based on file count
    • Detects breaking changes
    • Welcome message for first-time PR contributors
  3. check-pr-requirements

    • Validates PR title length
    • Checks for adequate description
    • Looks for issue references
    • Reminds about testing requirements
  4. manage-stale-issues

    • Marks issues/PRs stale after 60 days
    • Auto-closes after 7 more days
    • Exempts high-priority and pinned items
    • Customizable stale messages
  5. manage-labels

    • Ensures all required labels exist
    • Creates missing labels with proper colors
    • Maintains consistent label taxonomy

Key Features:

  • Intelligent content-based labeling
  • New contributor onboarding
  • Automated housekeeping
  • Consistent label management

6. Pull Request Validation Workflow (pr-validation.yml)

Purpose: Comprehensive PR analysis and quality feedback

Triggers:

  • 🔀 Pull Requests: opened, synchronize, reopened, ready_for_review
  • ✅ Reviews: submitted

Jobs:

  1. validate-changes

    • Analyzes all changed files
    • Categorizes changes (Java/Test/Docs/Build)
    • Validates test coverage for new code
    • Runs code quality analysis (Checkstyle, PMD)
    • Performance impact analysis
    • Security analysis for potential issues
    • Creates comprehensive PR analysis report
    • Updates existing comments instead of creating new ones
  2. check-breaking-changes

    • Detects removed or modified public APIs
    • Compares method signatures
    • Alerts on potential breaking changes
    • Only comments if issues found

Key Features:

  • Comprehensive change analysis
  • Test coverage validation
  • Multi-dimensional quality checks
  • Smart PR commenting (updates existing)
  • Breaking change detection

🛡️ Workflow Safety Features

All workflows include safety mechanisms:

  • Non-breaking: Quality checks use continue-on-error: true
  • Permissions: Minimal required permissions specified
  • Timeouts: Appropriate timeouts to prevent hanging
  • Draft PR support: Skip validation for draft PRs
  • Error handling: Graceful failure with informative messages

📊 Workflow Interactions

The workflows work together to provide comprehensive automation:

  1. PRs trigger validation, benchmarks, and documentation checks
  2. Merges trigger documentation deployment and benchmarks
  3. Tags trigger the release pipeline
  4. Schedule maintains dependency updates and stale management
  5. Issues/PRs get automatic labeling and management

🔧 Customization Options

Each workflow supports customization:

  • Manual triggers with parameters
  • Configurable schedules
  • Label exemptions
  • Timeout adjustments
  • Severity configurations

These workflows create a fully automated, developer-friendly CI/CD pipeline that maintains code quality without disrupting development flow.