Skip to content

Commit 9a11b70

Browse files
committed
Split GH workflows
1 parent 62f33d0 commit 9a11b70

File tree

10 files changed

+921
-130
lines changed

10 files changed

+921
-130
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Examples
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-examples:
8+
name: Build Example Apps
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: 17
20+
21+
- name: Cache Gradle
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
28+
restore-keys: |
29+
${{ runner.os }}-gradle-
30+
31+
- name: Grant execute permission for Gradle wrapper
32+
run: chmod +x gradlew
33+
34+
- name: Build Example01Pan
35+
run: ./gradlew :examples:Example01Pan:assembleDebug
36+
37+
- name: Build Example02Zoom
38+
run: ./gradlew :examples:Example02Zoom:assembleDebug
39+
40+
- name: Build Example03Markers
41+
run: ./gradlew :examples:Example03Markers:assembleDebug
42+
43+
- name: Upload example APKs
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: example-apks
47+
path: examples/**/build/outputs/apk/debug/*.apk
48+
retention-days: 30
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Library
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-library:
8+
name: Build OpenMapView AAR
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: 17
20+
21+
- name: Cache Gradle
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
28+
restore-keys: |
29+
${{ runner.os }}-gradle-
30+
31+
- name: Grant execute permission for Gradle wrapper
32+
run: chmod +x gradlew
33+
34+
- name: Build OpenMapView library
35+
run: ./gradlew :openmapview:assembleRelease
36+
37+
- name: Upload library artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: openmapview-aar
41+
path: openmapview/build/outputs/aar/*.aar
42+
retention-days: 30
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
name: Spotless Code Format Check
1+
name: Format Check
22

33
on:
4-
push:
5-
branches: [ main, master ]
6-
pull_request:
7-
branches: [ main, master ]
4+
workflow_call:
85

96
jobs:
10-
spotless-check:
11-
name: Verify Kotlin Code Formatting
7+
format:
8+
name: Check Code Formatting
129
runs-on: ubuntu-latest
1310

1411
steps:
@@ -36,4 +33,3 @@ jobs:
3633

3734
- name: Run Spotless check
3835
run: ./gradlew spotlessCheck
39-

.github/workflows/_setup.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Setup Java and Gradle
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
setup:
8+
name: Setup Environment
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: 17
20+
21+
- name: Cache Gradle
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
28+
restore-keys: |
29+
${{ runner.os }}-gradle-
30+
31+
- name: Grant execute permission for Gradle wrapper
32+
run: chmod +x gradlew

.github/workflows/_test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Unit Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: Run Unit Tests
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: 17
20+
21+
- name: Cache Gradle
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
28+
restore-keys: |
29+
${{ runner.os }}-gradle-
30+
31+
- name: Grant execute permission for Gradle wrapper
32+
run: chmod +x gradlew
33+
34+
- name: Run unit tests
35+
run: ./gradlew :openmapview:test --continue
36+
37+
- name: Upload test results
38+
if: always()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: test-results
42+
path: '**/build/test-results/test/*.xml'
43+
retention-days: 30
44+
45+
- name: Upload test reports
46+
if: always()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: test-reports
50+
path: '**/build/reports/tests/test/**'
51+
retention-days: 30

.github/workflows/ci.yml

Lines changed: 16 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -7,117 +7,22 @@ on:
77
branches: [ main, master ]
88

99
jobs:
10-
spotless-check:
11-
name: Verify Kotlin Code Formatting
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- name: Checkout repository
16-
uses: actions/checkout@v4
17-
18-
- name: Set up JDK 17
19-
uses: actions/setup-java@v4
20-
with:
21-
distribution: temurin
22-
java-version: 17
23-
24-
- name: Cache Gradle
25-
uses: actions/cache@v4
26-
with:
27-
path: |
28-
~/.gradle/caches
29-
~/.gradle/wrapper
30-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
31-
restore-keys: |
32-
${{ runner.os }}-gradle-
33-
34-
- name: Grant execute permission for Gradle wrapper
35-
run: chmod +x gradlew
36-
37-
- name: Run Spotless check
38-
run: ./gradlew spotlessCheck
10+
format:
11+
name: Check Formatting
12+
uses: ./.github/workflows/_format.yml
3913

4014
test:
41-
name: Run Unit Tests
42-
runs-on: ubuntu-latest
43-
needs: spotless-check
44-
45-
steps:
46-
- name: Checkout repository
47-
uses: actions/checkout@v4
48-
49-
- name: Set up JDK 17
50-
uses: actions/setup-java@v4
51-
with:
52-
distribution: temurin
53-
java-version: 17
54-
55-
- name: Cache Gradle
56-
uses: actions/cache@v4
57-
with:
58-
path: |
59-
~/.gradle/caches
60-
~/.gradle/wrapper
61-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
62-
restore-keys: |
63-
${{ runner.os }}-gradle-
64-
65-
- name: Grant execute permission for Gradle wrapper
66-
run: chmod +x gradlew
67-
68-
- name: Run unit tests
69-
run: ./gradlew :openmapview:test --continue
70-
71-
- name: Upload test results
72-
if: always()
73-
uses: actions/upload-artifact@v4
74-
with:
75-
name: test-results
76-
path: '**/build/test-results/test/*.xml'
77-
retention-days: 30
78-
79-
- name: Upload test reports
80-
if: always()
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: test-reports
84-
path: '**/build/reports/tests/test/**'
85-
retention-days: 30
86-
87-
build:
88-
name: Build Library & Examples
89-
runs-on: ubuntu-latest
90-
needs: [spotless-check, test] # run after tests pass
91-
92-
steps:
93-
- name: Checkout repository
94-
uses: actions/checkout@v4
95-
96-
- name: Set up JDK 17
97-
uses: actions/setup-java@v4
98-
with:
99-
distribution: temurin
100-
java-version: 17
101-
102-
- name: Cache Gradle
103-
uses: actions/cache@v4
104-
with:
105-
path: |
106-
~/.gradle/caches
107-
~/.gradle/wrapper
108-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
109-
restore-keys: |
110-
${{ runner.os }}-gradle-
111-
112-
- name: Grant execute permission for Gradle wrapper
113-
run: chmod +x gradlew
114-
115-
- name: Build OpenMapView library
116-
run: ./gradlew :openmapview:assembleRelease
117-
118-
- name: Build Example Apps
119-
run: |
120-
./gradlew :examples:Example01Pan:assembleDebug
121-
./gradlew :examples:Example02Zoom:assembleDebug
122-
./gradlew :examples:Example03Markers:assembleDebug
15+
name: Unit Tests
16+
needs: format
17+
uses: ./.github/workflows/_test.yml
18+
19+
build-library:
20+
name: Build Library
21+
needs: [format, test]
22+
uses: ./.github/workflows/_build-library.yml
23+
24+
build-examples:
25+
name: Build Examples
26+
needs: [format, test]
27+
uses: ./.github/workflows/_build-examples.yml
12328

0 commit comments

Comments
 (0)