-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (132 loc) · 4.87 KB
/
ci.yml
File metadata and controls
160 lines (132 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
security-events: write # Required for SARIF upload (Detekt code scanning)
jobs:
server-tests:
name: Server Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: server/
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: '21'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1
- name: Run tests
run: ./gradlew test --no-daemon
- name: Generate coverage report
if: success()
run: ./gradlew koverXmlReport koverHtmlReport --no-daemon
- name: Run Detekt
id: server-detekt
if: always()
run: ./gradlew detekt --no-daemon
- name: Upload test results
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: server-test-results
path: server/build/reports/tests/
retention-days: 14
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: server-coverage
path: server/build/reports/kover/
retention-days: 14
- name: Upload Detekt SARIF
if: always() && steps.server-detekt.outcome == 'success'
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
sarif_file: server/build/reports/detekt/detekt.sarif
category: server-detekt
android-build:
name: Android Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: android/
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: '17'
- name: Set up Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
- name: Set up Gradle
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1
- name: Run lint
run: ./gradlew lint --no-daemon
- name: Run unit tests
run: ./gradlew testDebugUnitTest --no-daemon
- name: Build debug APK
run: ./gradlew assembleDebug --no-daemon
- name: Upload debug APK
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: kidsync-debug-apk
path: android/app/build/outputs/apk/debug/app-debug.apk
retention-days: 30
- name: Generate coverage report
if: success()
run: ./gradlew koverXmlReportCustom koverHtmlReportCustom --no-daemon
- name: Run Detekt
id: android-detekt
if: always()
run: ./gradlew detekt --no-daemon
continue-on-error: true
- name: Upload lint report
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: android-lint-report
path: android/app/build/reports/lint-results*.html
retention-days: 14
- name: Upload test results
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: android-test-results
path: android/app/build/reports/tests/
retention-days: 14
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: android-coverage
path: android/app/build/reports/kover/
retention-days: 14
- name: Upload Detekt SARIF
if: always() && steps.android-detekt.outcome == 'success'
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
sarif_file: android/app/build/reports/detekt/detekt.sarif
category: android-detekt
conformance-tests:
name: Conformance Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python 3
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
- name: Run conformance tests
run: python3 tests/conformance/verify_conformance.py