feat: Initialize kotlin-multimodule-template #1
Workflow file for this run
This file contains hidden or 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
| name: Template Repository Setup | |
| description: Validate template repository structure and features | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| template-validation: | |
| runs-on: ubuntu-latest | |
| name: Validate Template Structure | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| 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: Validate template structure | |
| run: | | |
| echo "🔍 Validating template structure..." | |
| # Check required files exist | |
| required_files=( | |
| "build.gradle" | |
| "settings.gradle" | |
| "gradle.properties" | |
| "README.md" | |
| "customize.sh" | |
| "customize.ps1" | |
| "service-module/build.gradle" | |
| "springboot-application/build.gradle" | |
| ) | |
| for file in "${required_files[@]}"; do | |
| if [ ! -f "$file" ]; then | |
| echo "❌ Missing required file: $file" | |
| exit 1 | |
| else | |
| echo "✅ Found: $file" | |
| fi | |
| done | |
| - name: Validate customization scripts | |
| run: | | |
| echo "🔧 Validating customization scripts..." | |
| # Check bash script syntax | |
| if ! bash -n customize.sh; then | |
| echo "❌ Bash script has syntax errors" | |
| exit 1 | |
| fi | |
| echo "✅ Bash script syntax is valid" | |
| # Check PowerShell script syntax (basic check) | |
| if ! grep -q "param" customize.ps1; then | |
| echo "❌ PowerShell script missing parameters" | |
| exit 1 | |
| fi | |
| echo "✅ PowerShell script structure is valid" | |
| - name: Test build without customization | |
| run: | | |
| echo "🏗️ Testing default build..." | |
| ./gradlew build --no-daemon | |
| - name: Test small tests only | |
| run: | | |
| echo "🧪 Testing small test group..." | |
| ./gradlew test -PtestGroups=small --no-daemon | |
| - name: Test coverage verification | |
| run: | | |
| echo "📊 Testing coverage verification..." | |
| ./gradlew jacocoTestCoverageVerification --no-daemon | |
| - name: Validate template placeholders | |
| run: | | |
| echo "🔍 Checking for template placeholders..." | |
| # Check for common placeholder patterns that should be customizable | |
| template_checks=( | |
| "io.programmernewbie.template" | |
| "kotlin-multimodule-template" | |
| "KotlinMultimoduleTemplateApplication" | |
| "programmer-newbie-code" | |
| ) | |
| found_placeholders=0 | |
| for placeholder in "${template_checks[@]}"; do | |
| if grep -r "$placeholder" . --exclude-dir=.git --exclude-dir=build --exclude="*.md" --exclude="template-config.yml" > /dev/null; then | |
| echo "✅ Found customizable placeholder: $placeholder" | |
| found_placeholders=$((found_placeholders + 1)) | |
| fi | |
| done | |
| if [ $found_placeholders -lt 3 ]; then | |
| echo "❌ Not enough customizable placeholders found" | |
| exit 1 | |
| fi | |
| echo "✅ Template has sufficient customizable content" | |
| - name: Generate template report | |
| run: | | |
| echo "📋 Template Validation Report" | |
| echo "==============================" | |
| echo "✅ All required files present" | |
| echo "✅ Build successful" | |
| echo "✅ Tests passing with coverage" | |
| echo "✅ Customization scripts valid" | |
| echo "✅ Template placeholders found" | |
| echo "" | |
| echo "🎉 This repository is ready to be used as a GitHub template!" |