Skip to content

Commit 59fe2b5

Browse files
committed
Single build with multiple tests
1 parent e42c6bf commit 59fe2b5

File tree

1 file changed

+44
-7
lines changed

1 file changed

+44
-7
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Main AoC code
15+
uses: actions/checkout@v6
16+
17+
- name: Bring in the gradle wrapper running the build
18+
uses: gradle/wrapper-validation-action@v3
19+
20+
- name: Set up JDK 21
21+
uses: actions/setup-java@v5
22+
with:
23+
java-version: 21
24+
distribution: 'temurin'
25+
26+
- name: Grant execute permission for gradlew
27+
run: chmod +x gradlew
28+
29+
- name: Build with Gradle jacocoTestReport
30+
run: ./gradlew --no-daemon build -x test
31+
32+
- name: Upload build artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: build-output
36+
path: build/
37+
38+
test:
39+
runs-on: ubuntu-latest
40+
needs: build
1241
strategy:
1342
matrix:
1443
total_shard_count: [11]
@@ -26,14 +55,22 @@ jobs:
2655
path: advent-of-code-input
2756
ref: main
2857

29-
- name: Bring in the gradle wrapper running the build
30-
uses: gradle/wrapper-validation-action@v3
31-
32-
- name: Set up JDK 21
33-
uses: actions/setup-java@v5
58+
- name: Checkout repository
59+
uses: actions/checkout@v3
60+
- name: Download build artifact
61+
uses: actions/download-artifact@v5
3462
with:
35-
java-version: 21
36-
distribution: 'temurin'
63+
name: build-output
64+
path: .
65+
66+
# - name: Bring in the gradle wrapper running the build
67+
# uses: gradle/wrapper-validation-action@v3
68+
#
69+
# - name: Set up JDK 21
70+
# uses: actions/setup-java@v5
71+
# with:
72+
# java-version: 21
73+
# distribution: 'temurin'
3774

3875
- name: Grant execute permission for gradlew
3976
run: chmod +x gradlew

0 commit comments

Comments
 (0)