Skip to content

new structure

new structure #24

Workflow file for this run

name: CI ♻️

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 42, Col: 11): Unexpected symbol: '|'. Located at position 13 within expression: matrix.kind | upper, (Line: 121, Col: 23): Unexpected symbol: '|'. Located at position 21 within expression: matrix.build-system | upper
on:
pull_request:
push:
branches: [main, release]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: "🔍 Code Quality & Sanity"
runs-on: ubuntu-latest
env:
buildcacheuser: ${{ secrets.BUILDCACHE_USER }}
buildcachepass: ${{ secrets.BUILDCACHE_PASS }}
steps:
- name: "📥 Checkout Repository"
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: "☕️ Setup Java 21"
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: 21
- name: "💾 Configure Gradle Caching"
uses: gradle/actions/setup-gradle@v5
- name: "✨ Code Formatting (Spotless)"
run: ./gradlew spotlessCheck
- name: "🔄 Code Modernization (Rewrite)"
run: ./gradlew rewriteDryRun
- name: "⚙️ Build Preparations"
run: ./gradlew assemble testClasses
multi-platform-build:
name: "🏗️ ${{ matrix.kind | upper }} • Java ${{ matrix.jre }} • ${{ matrix.os }}"
needs: code-quality
strategy:
fail-fast: false
matrix:
build-system: [maven, gradle]
java-version: [17, 21, 24]
operating-system: [ubuntu-latest, windows-latest]
include:
- build-system: npm
java-version: 17
operating-system: ubuntu-latest
icon: "📦"
- build-system: shfmt
java-version: 17
operating-system: ubuntu-latest
shfmt-version: v3.8.0
icon: "🐚"
- build-system: idea
java-version: 17
operating-system: ubuntu-latest
icon: "💡"
runs-on: ${{ matrix.operating-system }}
steps:
- name: "📥 Checkout Code"
uses: actions/checkout@v6
- name: "☕️ Setup Java ${{ matrix.java-version }}"
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: ${{ matrix.java-version }}
- name: "💾 Gradle Build Cache"
uses: gradle/actions/setup-gradle@v5
- name: "🚀 Build Maven Plugin"
if: matrix.build-system == 'maven'
run: ./gradlew :plugin-maven:build -x spotlessCheck -x rewriteDryRun
- name: "🚀 Build Gradle Plugin"
if: matrix.build-system == 'gradle'
run: ./gradlew build -x spotlessCheck -x rewriteDryRun -PSPOTLESS_EXCLUDE_MAVEN=true
- name: "📦 Test NPM Integration"
if: matrix.build-system == 'npm'
run: ./gradlew testNpm
- name: "🦫 Setup Go Environment"
if: matrix.build-system == 'shfmt'
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: "🔧 Install shfmt ${{ matrix.shfmt-version }}"
if: matrix.build-system == 'shfmt'
run: go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }}
- name: "🧪 Test Shell Formatting"
if: matrix.build-system == 'shfmt'
run: ./gradlew testShfmt
- name: "💡 Test IntelliJ Integration"
if: matrix.build-system == 'idea'
run: |
DOWNLOAD_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=IIC&latest=true&type=release" | jq -r '.IIC[0].downloads.linux.link')
curl --location "$DOWNLOAD_URL" -o idea.tar.gz
tar -xf idea.tar.gz
cd idea-IC*
export PATH="$PATH:$(pwd)/bin"
cd ..
./gradlew testIdea
- name: "📊 Generate Test Report"
uses: mikepenz/action-junit-report@v6
if: always()
with:
check_name: "🧪 Test Results • ${{ matrix.build-system | upper }} • Java ${{ matrix.java-version }} • ${{ matrix.operating-system }}"
report_paths: '**/build/test-results/**/TEST-*.xml'
check_retries: true
detailed_summary: true
pipeline-status:
name: "✅ Pipeline Status"
needs: [code-quality, multi-platform-build]
runs-on: ubuntu-latest
if: always()
steps:
- name: "🔍 Validate All Jobs"
run: |
echo "🔎 Checking job results..."
# Convert JSON results to readable format
RESULTS="${{ toJSON(needs) }}"
echo "Raw results: $RESULTS"
# Check for any failures
FAILED_JOBS=$(echo "$RESULTS" | jq -r 'to_entries[] | select(.value.result != "success" and .value.result != "skipped") | " • \(.key): \(.value.result)"')
if [ -n "$FAILED_JOBS" ]; then
echo "❌ Pipeline failed due to:"
echo "$FAILED_JOBS"
exit 1
fi
TOTAL_JOBS=$(echo "$RESULTS" | jq 'length')
echo "🎉 All $TOTAL_JOBS required jobs completed successfully!"
- name: "📋 Pipeline Summary"
if: always()
run: |
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🚀 CI PIPELINE SUMMARY"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📅 Run: ${{ github.run_id }}"
echo "🔗 URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"