Skip to content

Commit b841081

Browse files
committed
Add GitHub Actions parallel build workflow
1 parent ec38242 commit b841081

File tree

1 file changed

+399
-0
lines changed

1 file changed

+399
-0
lines changed

.github/workflows/build.yml

Lines changed: 399 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,399 @@
1+
name: Build All Projects
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-section-01:
10+
name: "Section 01: Java Fundamentals (2 projects)"
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 25
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '25'
21+
distribution: 'temurin'
22+
cache: 'maven'
23+
24+
- name: Build all projects in section
25+
run: |
26+
set -e
27+
echo "Building Section 01: Java Fundamentals"
28+
find section-01-java-fundamentals -name pom.xml -not -path "*/target/*" | sort | while read pom; do
29+
echo "Building $(dirname $pom)"
30+
mvn clean compile -B -q -f "$pom" || {
31+
echo "Failed to compile $pom"
32+
exit 1
33+
}
34+
done
35+
echo "Section 01 completed successfully"
36+
37+
build-section-02:
38+
name: "Section 02: Conditionals (1 project)"
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: Set up JDK 25
46+
uses: actions/setup-java@v4
47+
with:
48+
java-version: '25'
49+
distribution: 'temurin'
50+
cache: 'maven'
51+
52+
- name: Build all projects in section
53+
run: |
54+
set -e
55+
echo "Building Section 02: Conditionals"
56+
find section-02-conditionals -name pom.xml -not -path "*/target/*" | sort | while read pom; do
57+
echo "Building $(dirname $pom)"
58+
mvn clean compile -B -q -f "$pom" || {
59+
echo "Failed to compile $pom"
60+
exit 1
61+
}
62+
done
63+
echo "Section 02 completed successfully"
64+
65+
build-section-03:
66+
name: "Section 03: Loops (1 project)"
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
73+
- name: Set up JDK 25
74+
uses: actions/setup-java@v4
75+
with:
76+
java-version: '25'
77+
distribution: 'temurin'
78+
cache: 'maven'
79+
80+
- name: Build all projects in section
81+
run: |
82+
set -e
83+
echo "Building Section 03: Loops"
84+
find section-03-loops -name pom.xml -not -path "*/target/*" | sort | while read pom; do
85+
echo "Building $(dirname $pom)"
86+
mvn clean compile -B -q -f "$pom" || {
87+
echo "Failed to compile $pom"
88+
exit 1
89+
}
90+
done
91+
echo "Section 03 completed successfully"
92+
93+
build-section-04:
94+
name: "Section 04: Methods (1 project)"
95+
runs-on: ubuntu-latest
96+
97+
steps:
98+
- name: Checkout code
99+
uses: actions/checkout@v4
100+
101+
- name: Set up JDK 25
102+
uses: actions/setup-java@v4
103+
with:
104+
java-version: '25'
105+
distribution: 'temurin'
106+
cache: 'maven'
107+
108+
- name: Build all projects in section
109+
run: |
110+
set -e
111+
echo "Building Section 04: Methods"
112+
find section-04-methods -name pom.xml -not -path "*/target/*" | sort | while read pom; do
113+
echo "Building $(dirname $pom)"
114+
mvn clean compile -B -q -f "$pom" || {
115+
echo "Failed to compile $pom"
116+
exit 1
117+
}
118+
done
119+
echo "Section 04 completed successfully"
120+
121+
build-section-05:
122+
name: "Section 05: Arrays (1 project)"
123+
runs-on: ubuntu-latest
124+
125+
steps:
126+
- name: Checkout code
127+
uses: actions/checkout@v4
128+
129+
- name: Set up JDK 25
130+
uses: actions/setup-java@v4
131+
with:
132+
java-version: '25'
133+
distribution: 'temurin'
134+
cache: 'maven'
135+
136+
- name: Build all projects in section
137+
run: |
138+
set -e
139+
echo "Building Section 05: Arrays"
140+
find section-05-arrays -name pom.xml -not -path "*/target/*" | sort | while read pom; do
141+
echo "Building $(dirname $pom)"
142+
mvn clean compile -B -q -f "$pom" || {
143+
echo "Failed to compile $pom"
144+
exit 1
145+
}
146+
done
147+
echo "Section 05 completed successfully"
148+
149+
build-section-06:
150+
name: "Section 06: Java OOP (18 projects)"
151+
runs-on: ubuntu-latest
152+
153+
steps:
154+
- name: Checkout code
155+
uses: actions/checkout@v4
156+
157+
- name: Set up JDK 25
158+
uses: actions/setup-java@v4
159+
with:
160+
java-version: '25'
161+
distribution: 'temurin'
162+
cache: 'maven'
163+
164+
- name: Build all projects in section
165+
run: |
166+
set -e
167+
echo "Building Section 06: Java OOP"
168+
find section-06-java-oop -name pom.xml -not -path "*/target/*" | sort | while read pom; do
169+
echo "Building $(dirname $pom)"
170+
mvn clean compile -B -q -f "$pom" || {
171+
echo "Failed to compile $pom"
172+
exit 1
173+
}
174+
done
175+
echo "Section 06 completed successfully"
176+
177+
build-section-07:
178+
name: "Section 07: Collections (7 projects)"
179+
runs-on: ubuntu-latest
180+
181+
steps:
182+
- name: Checkout code
183+
uses: actions/checkout@v4
184+
185+
- name: Set up JDK 25
186+
uses: actions/setup-java@v4
187+
with:
188+
java-version: '25'
189+
distribution: 'temurin'
190+
cache: 'maven'
191+
192+
- name: Build all projects in section
193+
run: |
194+
set -e
195+
echo "Building Section 07: Collections"
196+
find section-07-collections -name pom.xml -not -path "*/target/*" | sort | while read pom; do
197+
echo "Building $(dirname $pom)"
198+
mvn clean compile -B -q -f "$pom" || {
199+
echo "Failed to compile $pom"
200+
exit 1
201+
}
202+
done
203+
echo "Section 07 completed successfully"
204+
205+
build-section-08:
206+
name: "Section 08: Exception Handling (7 projects)"
207+
runs-on: ubuntu-latest
208+
209+
steps:
210+
- name: Checkout code
211+
uses: actions/checkout@v4
212+
213+
- name: Set up JDK 25
214+
uses: actions/setup-java@v4
215+
with:
216+
java-version: '25'
217+
distribution: 'temurin'
218+
cache: 'maven'
219+
220+
- name: Build all projects in section
221+
run: |
222+
set -e
223+
echo "Building Section 08: Exception Handling"
224+
find section-08-exception-handling -name pom.xml -not -path "*/target/*" | sort | while read pom; do
225+
echo "Building $(dirname $pom)"
226+
mvn clean compile -B -q -f "$pom" || {
227+
echo "Failed to compile $pom"
228+
exit 1
229+
}
230+
done
231+
echo "Section 08 completed successfully"
232+
233+
build-section-09:
234+
name: "Section 09: Lambdas & Streams (7 projects)"
235+
runs-on: ubuntu-latest
236+
237+
steps:
238+
- name: Checkout code
239+
uses: actions/checkout@v4
240+
241+
- name: Set up JDK 25
242+
uses: actions/setup-java@v4
243+
with:
244+
java-version: '25'
245+
distribution: 'temurin'
246+
cache: 'maven'
247+
248+
- name: Build all projects in section
249+
run: |
250+
set -e
251+
echo "Building Section 09: Lambdas & Streams"
252+
find section-09-lambdas-streams -name pom.xml -not -path "*/target/*" | sort | while read pom; do
253+
echo "Building $(dirname $pom)"
254+
mvn clean compile -B -q -f "$pom" || {
255+
echo "Failed to compile $pom"
256+
exit 1
257+
}
258+
done
259+
echo "Section 09 completed successfully"
260+
261+
build-section-10:
262+
name: "Section 10: Unit Testing (9 projects)"
263+
runs-on: ubuntu-latest
264+
265+
steps:
266+
- name: Checkout code
267+
uses: actions/checkout@v4
268+
269+
- name: Set up JDK 25
270+
uses: actions/setup-java@v4
271+
with:
272+
java-version: '25'
273+
distribution: 'temurin'
274+
cache: 'maven'
275+
276+
- name: Build all projects in section
277+
run: |
278+
set -e
279+
echo "Building Section 10: Unit Testing"
280+
find section-10-unit-testing-quick-start -name pom.xml -not -path "*/target/*" | sort | while read pom; do
281+
echo "Building $(dirname $pom)"
282+
mvn clean compile -B -q -f "$pom" || {
283+
echo "Failed to compile $pom"
284+
exit 1
285+
}
286+
done
287+
echo "Section 10 completed successfully"
288+
289+
build-section-11:
290+
name: "Section 11: TDD (3 projects)"
291+
runs-on: ubuntu-latest
292+
293+
steps:
294+
- name: Checkout code
295+
uses: actions/checkout@v4
296+
297+
- name: Set up JDK 25
298+
uses: actions/setup-java@v4
299+
with:
300+
java-version: '25'
301+
distribution: 'temurin'
302+
cache: 'maven'
303+
304+
- name: Build all projects in section
305+
run: |
306+
set -e
307+
echo "Building Section 11: TDD"
308+
find section-11-test-driven-development-quick-start -name pom.xml -not -path "*/target/*" | sort | while read pom; do
309+
echo "Building $(dirname $pom)"
310+
mvn clean compile -B -q -f "$pom" || {
311+
echo "Failed to compile $pom"
312+
exit 1
313+
}
314+
done
315+
echo "Section 11 completed successfully"
316+
317+
build-section-12:
318+
name: "Section 12: Spring Boot Quick Start (1 project)"
319+
runs-on: ubuntu-latest
320+
321+
steps:
322+
- name: Checkout code
323+
uses: actions/checkout@v4
324+
325+
- name: Set up JDK 25
326+
uses: actions/setup-java@v4
327+
with:
328+
java-version: '25'
329+
distribution: 'temurin'
330+
cache: 'maven'
331+
332+
- name: Build all projects in section
333+
run: |
334+
set -e
335+
echo "Building Section 12: Spring Boot Quick Start"
336+
find section-12-spring-boot-3-quick-start -name pom.xml -not -path "*/target/*" | sort | while read pom; do
337+
echo "Building $(dirname $pom)"
338+
mvn clean compile -B -q -f "$pom" || {
339+
echo "Failed to compile $pom"
340+
exit 1
341+
}
342+
done
343+
echo "Section 12 completed successfully"
344+
345+
build-section-13:
346+
name: "Section 13: Spring Boot REST APIs (4 projects)"
347+
runs-on: ubuntu-latest
348+
349+
steps:
350+
- name: Checkout code
351+
uses: actions/checkout@v4
352+
353+
- name: Set up JDK 25
354+
uses: actions/setup-java@v4
355+
with:
356+
java-version: '25'
357+
distribution: 'temurin'
358+
cache: 'maven'
359+
360+
- name: Build all projects in section
361+
run: |
362+
set -e
363+
echo "Building Section 13: Spring Boot REST APIs"
364+
find section-13-spring-boot-3-rest-apis-quick-start -name pom.xml -not -path "*/target/*" | sort | while read pom; do
365+
echo "Building $(dirname $pom)"
366+
mvn clean compile -B -q -f "$pom" || {
367+
echo "Failed to compile $pom"
368+
exit 1
369+
}
370+
done
371+
echo "Section 13 completed successfully"
372+
373+
build-section-14:
374+
name: "Section 14: Spring Boot MVC (2 projects)"
375+
runs-on: ubuntu-latest
376+
377+
steps:
378+
- name: Checkout code
379+
uses: actions/checkout@v4
380+
381+
- name: Set up JDK 25
382+
uses: actions/setup-java@v4
383+
with:
384+
java-version: '25'
385+
distribution: 'temurin'
386+
cache: 'maven'
387+
388+
- name: Build all projects in section
389+
run: |
390+
set -e
391+
echo "Building Section 14: Spring Boot MVC"
392+
find section-14-spring-boot-3-spring-mvc-quick-start -name pom.xml -not -path "*/target/*" | sort | while read pom; do
393+
echo "Building $(dirname $pom)"
394+
mvn clean compile -B -q -f "$pom" || {
395+
echo "Failed to compile $pom"
396+
exit 1
397+
}
398+
done
399+
echo "Section 14 completed successfully"

0 commit comments

Comments
 (0)