Repository navigation
273 lines (258 loc) · 8.91 KB
/
Copy pathci.yml
File metadata and controls
273 lines (258 loc) · 8.91 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: CI
run-name: CI · ${{ github.event.pull_request.title || github.ref_name }}
on:
workflow_dispatch:
inputs:
release_dry_run_version:
description: "Optional release version X.Y.Z for a read-only check with live changelog generation"
required: false
type: string
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
release-dry-run:
name: Release dry run
if: github.event_name == 'workflow_dispatch' && inputs.release_dry_run_version != ''
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Check release configuration and generate changelogs
env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_RELEASE_MODEL: ${{ vars.OPENAI_RELEASE_MODEL || secrets.OPENAI_RELEASE_MODEL }}
RELEASE_VERSION: ${{ inputs.release_dry_run_version }}
run: |
test -n "$GH_TOKEN" && test -n "$OPENAI_API_KEY" && test -n "$OPENAI_RELEASE_MODEL"
gh auth setup-git
python3 scripts/release_automation.py prepare --version "$RELEASE_VERSION" --dry-run
release-identity:
name: Release CI identity
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: 'Comparison base: ${{ github.event.pull_request.base.sha }}'
run: 'true'
- name: 'Pull request: ${{ github.event.pull_request.number }}'
run: 'true'
android:
name: Android tests and checks
if: github.event_name != 'workflow_dispatch' || inputs.release_dry_run_version == ''
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- uses: gradle/actions/setup-gradle@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4.10"
bundler-cache: true
- name: Install Android SDK components
run: |
sdkmanager="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
if [[ ! -x "$sdkmanager" ]]; then
echo "Android SDK manager is unavailable: $sdkmanager" >&2
exit 1
fi
"$sdkmanager" "platforms;android-36" "build-tools;36.0.0"
- run: bundle exec fastlane android checks
- name: Check branding vector conversion
env:
MESSAGE487_TEST_ANDROID_VECTORS: "1"
run: python3 -m unittest discover -s scripts/tests -p test_generate_branding.py
- name: Publish test and lint reports
if: always()
uses: actions/upload-artifact@v7
with:
name: android-test-reports
path: |
app/build/reports/tests/
app/build/test-results/
app/build/reports/lint-results-*
if-no-files-found: warn
retention-days: 14
- name: Upload Android JUnit reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: junit-Android JVM
path: app/build/test-results/testDebugUnitTest/*.xml
retention-days: 14
- uses: actions/upload-artifact@v7
id: apk
with:
name: message487-pr-${{ github.event.pull_request.number || github.run_id }}-debug-apk
path: app/build/outputs/apk/debug/app-debug.apk
if-no-files-found: error
retention-days: 14
- uses: actions/upload-artifact@v7
id: release_apk
with:
name: message487-pr-${{ github.event.pull_request.number || github.run_id }}-unsigned-release-apk
path: app/build/outputs/apk/release/app-release-unsigned.apk
if-no-files-found: error
retention-days: 14
- name: Link build artifacts
env:
DEBUG_URL: ${{ steps.apk.outputs.artifact-url }}
RELEASE_URL: ${{ steps.release_apk.outputs.artifact-url }}
run: |
echo "[Download debug APK]($DEBUG_URL)" >> "$GITHUB_STEP_SUMMARY"
echo "[Download unsigned release APK]($RELEASE_URL)" >> "$GITHUB_STEP_SUMMARY"
python:
if: github.event_name != 'workflow_dispatch' || inputs.release_dry_run_version == ''
name: Python tests and style
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4.10"
bundler-cache: true
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-dev.txt
- run: python -m pip install -r requirements-dev.txt
- run: bundle exec fastlane android python_checks
- name: Upload Python JUnit reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: junit-Python
path: test-results/python/**/*.xml
retention-days: 14
dev-server:
name: Development server tests
if: github.event_name != 'workflow_dispatch' || inputs.release_dry_run_version == ''
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: docker compose -f DevServer/compose.yaml up -d --wait --wait-timeout 300
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4.10"
bundler-cache: true
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- run: python -m pip install -r requirements-dev.txt
- run: bundle exec fastlane android server_tests
- name: Upload n8n JUnit reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: junit-n8n
path: test-results/server/*.xml
retention-days: 14
- name: Server logs
if: failure()
run: docker compose -f DevServer/compose.yaml logs --tail 150
- name: Stop server
if: always()
run: docker compose -f DevServer/compose.yaml down
emulator26:
name: Android emulator API 26
if: github.event_name != 'workflow_dispatch' || inputs.release_dry_run_version == ''
uses: ./.github/workflows/android-device.yml
with:
api: 26
emulator35:
name: Android emulator API 35
if: github.event_name != 'workflow_dispatch' || inputs.release_dry_run_version == ''
uses: ./.github/workflows/android-device.yml
with:
api: 35
report-android:
name: Publish Android JVM results
needs: android
if: >-
!cancelled() && needs.android.result != 'skipped' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
permissions:
contents: read
actions: read
checks: write
uses: ./.github/workflows/test-reports.yml
with:
artifact: '/^junit-(Android JVM)$/'
report-python:
name: Publish Python results
needs: python
if: >-
!cancelled() && needs.python.result != 'skipped' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
permissions:
contents: read
actions: read
checks: write
uses: ./.github/workflows/test-reports.yml
with:
artifact: '/^junit-(Python)$/'
report-dev-server:
name: Publish n8n results
needs: dev-server
if: >-
!cancelled() && needs.dev-server.result != 'skipped' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
permissions:
contents: read
actions: read
checks: write
uses: ./.github/workflows/test-reports.yml
with:
artifact: '/^junit-(n8n)$/'
report-emulator26:
name: Publish Android API 26 results
needs: emulator26
if: >-
!cancelled() && needs.emulator26.result != 'skipped' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
permissions:
contents: read
actions: read
checks: write
uses: ./.github/workflows/test-reports.yml
with:
artifact: '/^junit-(Android API 26)$/'
report-emulator35:
name: Publish Android API 35 results
needs: emulator35
if: >-
!cancelled() && needs.emulator35.result != 'skipped' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
permissions:
contents: read
actions: read
checks: write
uses: ./.github/workflows/test-reports.yml
with:
artifact: '/^junit-(Android API 35)$/'