Skip to content

Commit 0071dbb

Browse files
author
Vincent Potucek
committed
new structure
1 parent d5684fe commit 0071dbb

File tree

1 file changed

+108
-62
lines changed

1 file changed

+108
-62
lines changed

.github/workflows/ci.yml

Lines changed: 108 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,112 +8,158 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.ref }}
99
cancel-in-progress: true
1010
jobs:
11-
sanity-check:
12-
name: SanityCheck 🕊️
11+
code-quality:
12+
name: "🔍 Code Quality & Sanity"
1313
runs-on: ubuntu-latest
1414
env:
1515
buildcacheuser: ${{ secrets.BUILDCACHE_USER }}
1616
buildcachepass: ${{ secrets.BUILDCACHE_PASS }}
1717
steps:
18-
- name: Checkout 📥
18+
- name: "📥 Checkout Repository"
1919
uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 0
22-
- name: Setup Java ☕️
22+
23+
- name: "☕️ Setup Java 21"
2324
uses: actions/setup-java@v5
2425
with:
2526
distribution: "temurin"
2627
java-version: 21
27-
- name: Gradle Caching 💾
28+
29+
- name: "💾 Configure Gradle Caching"
2830
uses: gradle/actions/setup-gradle@v5
29-
- name: Spotless Check ✨
31+
32+
- name: "✨ Code Formatting (Spotless)"
3033
run: ./gradlew spotlessCheck
31-
- name: Rewrite Dry Run 🌀
34+
35+
- name: "🔄 Code Modernization (Rewrite)"
3236
run: ./gradlew rewriteDryRun
33-
- name: Assemble TestClasses ⚙️
37+
38+
- name: "⚙️ Build Preparations"
3439
run: ./gradlew assemble testClasses
35-
build:
36-
name: Build 🏗 ${{ matrix.kind }}️, Java ☕️ ${{ matrix.jre }}, OS 💿 ${{ matrix.os }}
37-
needs: sanity-check
40+
41+
multi-platform-build:
42+
name: "🏗️ ${{ matrix.kind | upper }} • Java ${{ matrix.jre }} • ${{ matrix.os }}"
43+
needs: code-quality
3844
strategy:
3945
fail-fast: false
4046
matrix:
41-
kind: [maven, gradle]
42-
jre: [17, 21, 24] # Test on the latest Java version once Gradle & Maven support it.
43-
os: [ubuntu-latest, windows-latest]
44-
include: # npm on linux only (crazy slow on windows)
45-
- kind: npm
46-
jre: 17
47-
os: ubuntu-latest
48-
- kind: shfmt
49-
jre: 17
50-
os: ubuntu-latest
47+
build-system: [maven, gradle]
48+
java-version: [17, 21, 24]
49+
operating-system: [ubuntu-latest, windows-latest]
50+
include:
51+
- build-system: npm
52+
java-version: 17
53+
operating-system: ubuntu-latest
54+
icon: "📦"
55+
- build-system: shfmt
56+
java-version: 17
57+
operating-system: ubuntu-latest
5158
shfmt-version: v3.8.0
52-
- kind: idea
53-
jre: 17
54-
os: ubuntu-latest
55-
runs-on: ${{ matrix.os }}
59+
icon: "🐚"
60+
- build-system: idea
61+
java-version: 17
62+
operating-system: ubuntu-latest
63+
icon: "💡"
64+
65+
runs-on: ${{ matrix.operating-system }}
66+
5667
steps:
57-
- name: Checkout 📥
68+
- name: "📥 Checkout Code"
5869
uses: actions/checkout@v6
59-
- name: Setup Java ☕️
70+
71+
- name: "☕️ Setup Java ${{ matrix.java-version }}"
6072
uses: actions/setup-java@v5
6173
with:
6274
distribution: "temurin"
63-
java-version: ${{ matrix.jre }}
64-
- name: Gradle Caching 💾
75+
java-version: ${{ matrix.java-version }}
76+
77+
- name: "💾 Gradle Build Cache"
6578
uses: gradle/actions/setup-gradle@v5
66-
- name: Build (Maven) 🏗️
67-
if: matrix.kind == 'maven'
79+
80+
# Main Build Steps
81+
- name: "🚀 Build Maven Plugin"
82+
if: matrix.build-system == 'maven'
6883
run: ./gradlew :plugin-maven:build -x spotlessCheck -x rewriteDryRun
69-
- name: Build (Gradle) 🏗️
70-
if: matrix.kind == 'gradle'
84+
85+
- name: "🚀 Build Gradle Plugin"
86+
if: matrix.build-system == 'gradle'
7187
run: ./gradlew build -x spotlessCheck -x rewriteDryRun -PSPOTLESS_EXCLUDE_MAVEN=true
72-
- name: Test NPM 🧪
73-
if: matrix.kind == 'npm'
88+
89+
- name: "📦 Test NPM Integration"
90+
if: matrix.build-system == 'npm'
7491
run: ./gradlew testNpm
75-
- name: Setup Go 🦫
76-
if: matrix.kind == 'shfmt'
92+
93+
# Shell Formatting Tests
94+
- name: "🦫 Setup Go Environment"
95+
if: matrix.build-system == 'shfmt'
7796
uses: actions/setup-go@v6
7897
with:
7998
go-version: 'stable'
80-
- name: Install shfmt 🔧
81-
if: matrix.kind == 'shfmt'
82-
run: |
83-
go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }}
84-
- name: Test shfmt 🧪
85-
if: matrix.kind == 'shfmt'
99+
100+
- name: "🔧 Install shfmt ${{ matrix.shfmt-version }}"
101+
if: matrix.build-system == 'shfmt'
102+
run: go install mvdan.cc/sh/v3/cmd/shfmt@${{ matrix.shfmt-version }}
103+
104+
- name: "🧪 Test Shell Formatting"
105+
if: matrix.build-system == 'shfmt'
86106
run: ./gradlew testShfmt
87-
- name: Test IntelliJ IDEA 🧪
88-
if: matrix.kind == 'idea'
107+
108+
# IntelliJ Integration Tests
109+
- name: "💡 Test IntelliJ Integration"
110+
if: matrix.build-system == 'idea'
89111
run: |
90-
download_link=$(curl https://data.services.jetbrains.com/products/releases\?code\=IIC\&latest\=true\&type\=release | jq -r '.IIC[0].downloads.linux.link')
91-
curl --location "$download_link" -o idea.tar.gz
112+
DOWNLOAD_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=IIC&latest=true&type=release" | jq -r '.IIC[0].downloads.linux.link')
113+
curl --location "$DOWNLOAD_URL" -o idea.tar.gz
92114
tar -xf idea.tar.gz
93115
cd idea-IC*
94-
export PATH=${PATH}:$(pwd)/bin
116+
export PATH="$PATH:$(pwd)/bin"
95117
cd ..
96118
./gradlew testIdea
97-
- name: Test Results 📊
119+
120+
# Test Reporting
121+
- name: "📊 Generate Test Report"
98122
uses: mikepenz/action-junit-report@v6
99-
if: always() # always run even if the previous step fails
123+
if: always()
100124
with:
101-
check_name: JUnit (Build 🏗 ${{ matrix.kind }}️, Java ☕️ ${{ matrix.jre }}, OS 💿 ${{ matrix.os }})
102-
report_paths: '*/build/test-results/*/TEST-*.xml'
125+
check_name: "🧪 Test Results • ${{ matrix.build-system | upper }} • Java ${{ matrix.java-version }}${{ matrix.operating-system }}"
126+
report_paths: '**/build/test-results/**/TEST-*.xml'
103127
check_retries: true
104-
final-status: # Status check that is required in branch protection rules.
105-
name: Final Status 🎯
106-
needs:
107-
- sanity-check
108-
- build
128+
detailed_summary: true
129+
130+
pipeline-status:
131+
name: "✅ Pipeline Status"
132+
needs: [code-quality, multi-platform-build]
109133
runs-on: ubuntu-latest
110134
if: always()
135+
111136
steps:
112-
- name: Check All Jobs
137+
- name: "🔍 Validate All Jobs"
113138
run: |
114-
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
115-
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
116-
echo "One or more required jobs failed ❌"
139+
echo "🔎 Checking job results..."
140+
141+
# Convert JSON results to readable format
142+
RESULTS="${{ toJSON(needs) }}"
143+
echo "Raw results: $RESULTS"
144+
145+
# Check for any failures
146+
FAILED_JOBS=$(echo "$RESULTS" | jq -r 'to_entries[] | select(.value.result != "success" and .value.result != "skipped") | " • \(.key): \(.value.result)"')
147+
148+
if [ -n "$FAILED_JOBS" ]; then
149+
echo "❌ Pipeline failed due to:"
150+
echo "$FAILED_JOBS"
117151
exit 1
118152
fi
119-
echo "All required jobs completed successfully. ✅"
153+
154+
TOTAL_JOBS=$(echo "$RESULTS" | jq 'length')
155+
echo "🎉 All $TOTAL_JOBS required jobs completed successfully!"
156+
157+
- name: "📋 Pipeline Summary"
158+
if: always()
159+
run: |
160+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
161+
echo "🚀 CI PIPELINE SUMMARY"
162+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
163+
echo "📅 Run: ${{ github.run_id }}"
164+
echo "🔗 URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
165+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

0 commit comments

Comments
 (0)