|
7 | 7 | branches: [ main, master ] |
8 | 8 |
|
9 | 9 | 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 |
39 | 13 |
|
40 | 14 | 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 |
123 | 28 |
|
0 commit comments