-
Notifications
You must be signed in to change notification settings - Fork 535
889 lines (865 loc) · 31.9 KB
/
Copy pathci.yml
File metadata and controls
889 lines (865 loc) · 31.9 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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
name: ci
on:
pull_request:
push:
branches:
- CQ-*
defaults:
run:
working-directory: lynx
jobs:
static-check:
runs-on: lynx-ubuntu-22.04-medium
timeout-minutes: 30
steps:
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Download Source
uses: actions/checkout@v4.2.2
with:
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Run file type check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers file-type
- name: Run cpplint check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers cpplint
- name: Run java-lint check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers java-lint
- name: Run commit-message check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers commit-message
- name: Run coding-style check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers coding-style
- name: Run android-check-style check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers android-check-style
- name: Run api check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers api-check --all
- name: Run gn relative path check
run: |
source tools/envsetup.sh
python3 tools_shared/git_lynx.py check --checkers gn-relative-path-check
darwin-native-unittests-check:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Run Unittests
run: |
set -e
source tools/envsetup.sh
tools/rtf/rtf native-ut run --names lynx
linux-native-unittests-check:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Run Unittests
run: |
set -e
source tools/envsetup.sh
tools/rtf/rtf native-ut run --names lynx
linux-native-devtool-unittests-check:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Run Unittests
run: |
set -e
source tools/envsetup.sh
tools/rtf/rtf native-ut run --names devtool
ios-unittests-check:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Setup Ruby Cache
uses: ./lynx/.github/actions/ios-common-deps
with:
cache-backend: 'lynx-infra'
- name: Install iOS Dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 3
command: |
set -e
cd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pushd explorer/darwin/ios/lynx_explorer
git config --global url."https://github.com/".insteadOf "git@github.com:"
bash bundle_install.sh --skip-card-build
popd
- name: Run Unittests
run: |
set -e
source tools/envsetup.sh
pushd explorer/darwin/ios/lynx_explorer
xcodebuild -showsdks | grep -Eo -m 1 "iphonesimulator([0-9]{1,}\.)+[0-9]{1,}" > sdk.txt
sdkVersion=$(awk '{ sub(/iphonesimulator/,""); print $0 }' sdk.txt)
echo $sdkVersion > sdk.txt
xcodebuild build-for-testing ARCHS=arm64 -workspace LynxExplorer.xcworkspace -scheme LynxExplorerTests -enableCodeCoverage YES -configuration Debug -sdk iphonesimulator$(cat sdk.txt) COMPILER_INDEX_STORE_ENABLE=NO -derivedDataPath iOSCoreBuild/DerivedData -dest"platform=iOS Simulator,OS=$(cat sdk.txt),name=iPhone 11" SYMROOT=`pwd`/Build/Products -testPlan UTTest
chmod u+x xctestrunner
./xctestrunner --xctestrun `pwd`/Build/Products/LynxExplorerTests_UTTest_iphonesimulator$(cat sdk.txt)-arm64.xctestrun --work_dir `pwd` --output_dir `pwd`/iOSCoreBuild/DerivedData simulator_test
popd
tasm-linux-build:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Build Linux Tasm
run: |
source tools/envsetup.sh
pushd oliver/lynx-tasm
npm install
npm run build:release:linux
popd
tasm-darwin-build:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Build Darwin Tasm
run: |
source tools/envsetup.sh
python3 tools/oliver/lynx-tasm/gn_to_cmake_oliver.py
pushd oliver/lynx-tasm
npm install
../../buildtools/cmake/bin/cmake .
../../buildtools/cmake/bin/cmake --build .
./lepus_cmd
npm run build:release:darwin
popd
tasm-wasm-build:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
with:
target: tasm
- name: Build Wasm Tasm
run: |
source tools/envsetup.sh
pushd oliver/lynx-tasm
npm install
npm run build:wasm
popd
lynx-types-check:
runs-on: lynx-ubuntu-22.04-medium
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Lynx Types Check
run: |
cd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pushd js_libraries/types
npm run test
popd
android-unittests-check:
timeout-minutes: 60
runs-on: lynx-ubuntu-22.04-physical-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Setup gradle cache
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/caches/modules-2
key: gradle-android-unittests-check
- name: Build Example App
run: |
source tools/envsetup.sh
tools/rtf/rtf android-ut run --name lynx
android-explorer-build:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Setup gradle cache
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/caches/modules-2
key: gradle-android-explorer-build
- name: Build Explorer App
uses: ./lynx/.github/actions/android-explorer-build
with:
abi-list: x86,arm64-v8a
build-params: -PIntegrationTest
windows-explorer-build:
# Disable temporarily due to flakiness
if: false
runs-on: lynx-windows-2022-large
strategy:
matrix:
arch: [x86, x64]
steps:
- name: Configure Git
shell: PowerShell
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global http.sslBackend "schannel"
working-directory: ./
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Build windows Explorer
uses: ./lynx/.github/actions/windows-explorer-build
with:
build-arch: ${{ matrix.arch }}
android-sdk-release:
timeout-minutes: 60
runs-on: lynx-ubuntu-22.04-large
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
with:
cache-backend: 'lynx-infra'
- name: Setup gradle cache
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/caches/modules-2
key: gradle-android-sdk-release
- name: Build Android SDK
uses: ./lynx/.github/actions/android-sdk-release
with:
version: 0.0.1-alpha.1
- name: Collect and zip artifacts
run: |
cd $GITHUB_WORKSPACE/lynx/platform/android
./gradlew zipAllArtifacts
- name: upload zip artifact
uses: lynx-infra/upload-artifact@332ec52e99f7cbf1fbbdc9bcc09280d49147d092
continue-on-error: true
with:
name: android-sdk-release
path: '${{ github.workspace }}/lynx/platform/android/build/artifacts-collection.zip'
android-e2e-test:
timeout-minutes: 60
needs: [android-explorer-build]
env:
APPIUM_TEST_SERVER_PORT: 4723
APPIUM_TEST_SERVER_HOST: 127.0.0.1
runs-on: lynx-ubuntu-22.04-physical-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Install Appium
run: |
pushd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pnpm install appium@2.11.2 -w
pnpm install appium-espresso-driver@4.0.0 -w
popd
- name: Setup Java SDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: Gradle Wrapper Cache
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/wrapper/dists
key: gradle-8.7-${{ runner.os }}
- name: Start Android 28 emulator
run: |
set -x
target_avd=$(emulator -list-avds | head -n 1)
if [ -z "$target_avd" ]; then
echo "No available emulator was found!"
exit 1
fi
export QT_QPA_PLATFORM=offscreen
nohup $ANDROID_HOME/emulator/emulator -no-window -avd $target_avd -no-snapshot -no-audio -no-boot-anim &
max_wait_time=300
start_time=$(date +%s)
while true; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -gt $max_wait_time ]; then
echo "Emulator startup timed out."
exit 1
fi
$ANDROID_HOME/platform-tools/adb devices
if $ANDROID_HOME/platform-tools/adb devices | grep -q "device$"; then
echo "Emulator startup completed."
break
fi
echo "Waiting for emulator to startup..."
sleep 10
done
$ANDROID_HOME/platform-tools/adb devices
- name: Download Explorer APK
uses: lynx-infra/download-artifact@79d9914484f933089c2840552cf439bac85debad
with:
name: android-lynx-explorer
path: lynx/explorer/android/lynx_explorer/build_temp
- name: Repack and Install Explorer App
run: |
pushd $GITHUB_WORKSPACE/lynx
LATEST_VERSION=$(ls -1 "$ANDROID_HOME/build-tools" | sort -V | tail -n 1)
target_dir=$(find ./node_modules/.pnpm -type d -name "appium-adb@*" | head -n 1)
ESPRESSO_SIGN_KEYS_DIR=""
if [ -n "$target_dir" ]; then
ESPRESSO_SIGN_KEYS_DIR="$target_dir/node_modules/appium-adb/keys"
else
echo "node_modules/.pnpm/appium-adb is not founded!"
exit 1
fi
APK_PATH=${{ github.workspace }}/lynx/explorer/android/lynx_explorer/build_temp
java -jar $ANDROID_HOME/build-tools/$LATEST_VERSION/lib/apksigner.jar sign --key $ESPRESSO_SIGN_KEYS_DIR/testkey.pk8 --cert $ESPRESSO_SIGN_KEYS_DIR/testkey.x509.pem --out $APK_PATH/LynxExplorer-noasan-release-signed.apk $APK_PATH/LynxExplorer-noasan-release.apk
adb install $APK_PATH/LynxExplorer-noasan-release-signed.apk
- name: Start Appium server
run: |
pushd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pushd node_modules/appium/node_modules/.bin
ls
nohup ./appium server \
--port=$APPIUM_TEST_SERVER_PORT \
--address=$APPIUM_TEST_SERVER_HOST \
--log-no-colors \
--log-timestamp \
2>&1 > "$GITHUB_WORKSPACE/lynx/appium.log" &
adb logcat > "$GITHUB_WORKSPACE/lynx/device.log" 2>&1 &
popd
popd
- name: Check if Appium Server is running
run: |
max_attempts=10
attempt=0
while [ $attempt -lt $max_attempts ]; do
if nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; then
echo "Appium Server is running."
break
else
attempt=$((attempt + 1))
echo "Attempt $attempt: Appium Server is not yet running. Retrying in 2 seconds..."
sleep 2
fi
done
if [ $attempt -eq $max_attempts ]; then
echo "Failed to start Appium Server."
exit 1
fi
- name: Run Android E2E Test
uses: nick-fields/retry@v3
with:
max_attempts: 2
retry_wait_seconds: 5
timeout_minutes: 20
command: |
set -e
source $GITHUB_WORKSPACE/lynx/tools/envsetup.sh
pushd $GITHUB_WORKSPACE/lynx/testing/integration_test/test_script
export server_port=$APPIUM_TEST_SERVER_PORT
export platform=android
python3 -m pip install -r requirements.txt
python3 manage.py runtest android_test.core
echo "TASK_STATUS=success" >> $GITHUB_OUTPUT
id: run_test
- name: Collect Lynx-E2E execution logs
if: always()
run: |
TASK_STATUS="${{ steps.run_test.outputs.TASK_STATUS }}"
if [ -n "$TASK_STATUS" ] && [ "$TASK_STATUS" = "success" ]; then
echo "Test execution succeeded."
else
echo "Test execution failed, collecting logs..."
pushd $GITHUB_WORKSPACE/lynx/testing/integration_test/test_script
ls | grep -E "^lynx_e2e_devtools_.*\.log$" | xargs cat
popd
fi
- name: Collect Appium Server logs
if: always()
run: |
TASK_STATUS="${{ steps.run_test.outputs.TASK_STATUS }}"
if [ -n "$TASK_STATUS" ] && [ "$TASK_STATUS" = "success" ]; then
echo "Test execution succeeded."
else
echo "Test execution failed, collecting logs..."
pushd $GITHUB_WORKSPACE/lynx/
if [ -f "appium.log" ]; then
cat appium.log
else
echo "Warning: appium.log file not found"
fi
popd
fi
- name: Collect Generated Resource Files
if: always()
run: |
TASK_STATUS="${{ steps.run_test.outputs.TASK_STATUS }}"
if [ -n "$TASK_STATUS" ] && [ "$TASK_STATUS" = "success" ]; then
echo "Test execution succeeded."
else
pushd $GITHUB_WORKSPACE/lynx/testing/integration_test/test_script
if [ -d "screenshots" ]; then
zip -r screenshots.zip ./screenshots/
echo "Successfully created screenshots.zip"
echo "ZIP_RESOURCES=success" >> $GITHUB_OUTPUT
else
echo "Warning: screenshot directory not found"
fi
fi
id: collect_resource
- name: Upload Generated Resource Files
if: always() && steps.collect_resource.outputs.ZIP_RESOURCES == 'success'
uses: lynx-infra/upload-artifact@332ec52e99f7cbf1fbbdc9bcc09280d49147d092
continue-on-error: true
with:
name: android-e2e-resources
path: '${{ github.workspace }}/lynx/testing/integration_test/test_script/screenshots.zip'
android-integeration-test:
needs: [android-sdk-release]
timeout-minutes: 15
runs-on: lynx-ubuntu-22.04-large
steps:
- name: Download Integeration Demo Source Code
uses: actions/checkout@v4.2.2
with:
repository: lynx-family/integrating-lynx-demo-projects
ref: b106f7f21d5221acfed645f4afa9d829a1cc0cc2
path: lynx
- name: Cherry Pick Commit To Build With Local AAR
run: |
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git fetch origin 12858f5a4f51454057f738f0b1d2bb001986dc91
git cherry-pick 12858f5a4f51454057f738f0b1d2bb001986dc91
- name: Download Lynx SDK Artifacts
uses: lynx-infra/download-artifact@79d9914484f933089c2840552cf439bac85debad
with:
name: android-sdk-release
path: lynx
- name: Python Setup
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Setup Java SDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: Gradle Wrapper Cache
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/wrapper/dists
key: gradle-wrapper-${{ runner.os }}
- name: Setup cache action
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/caches/modules-2
key: gradle-integration-deps-${{ runner.os }}
- name: Build With Local AAR
id: build_apk
run: |
set -e
pushd android/JavaEmptyProject/
python3 shell/prepare_package_with_local_aar.py $GITHUB_WORKSPACE/lynx/artifacts-collection.zip 0.0.1-alpha.1
./gradlew publishAllZips
./gradlew :app:assembleDebug
popd
harmony-explorer-build:
runs-on: lynx-custom-container
container:
image: ghcr.io/lynx-family/ubuntu24.04-harmony@sha256:bf493c3710de3c44bfa84caf402c0727b9310c42497f6e52580ad441ea640ef1
credentials:
username: lynx-family
password: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Build Explorer App
uses: ./lynx/.github/actions/harmony-explorer-build
ios-explorer-build:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
strategy:
matrix:
arch: [arm64, x86_64]
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Build Explorer App
uses: ./lynx/.github/actions/ios-explorer-build
with:
build-arch: ${{ matrix.arch }}
build-params: '--integration-test'
- name: upload artifact
uses: lynx-infra/upload-artifact@332ec52e99f7cbf1fbbdc9bcc09280d49147d092
continue-on-error: true
with:
name: ios-explorer-build-${{ matrix.arch }}
path: '${{ github.workspace }}/lynx/LynxExplorer-${{ matrix.arch }}.app.tar.gz'
ios-integration-test:
timeout-minutes: 15
runs-on: lynx-darwin-14-medium
env:
LOCAL_POD_NAME: 'local_pod'
POD_VERSION: '0.0.1-alpha.1'
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Setup Ruby Cache
uses: ./lynx/.github/actions/ios-common-deps
with:
cache-backend: 'lynx-infra'
- name: Prepare cocoapods publish source
run: |-
source tools/envsetup.sh
export LANG=en_US.UTF-8
python3 tools/ios_tools/cocoapods_publish_helper.py --prepare-source --tag $POD_VERSION --version $POD_VERSION --component all
- name: Publish to Local Pod Source
run: |-
cd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
git config --global user.name "lynx.authors"
git config --global user.email "lynx.authors@users.noreply.github.com"
python3 tools/ios_tools/cocoapods_publish_helper.py --publish_local $LOCAL_POD_NAME --component all
- name: Download the Demo Project
uses: actions/checkout@v4.2.2
with:
path: demo
repository: lynx-family/integrating-lynx-demo-projects
ref: 0ab9340e1e560f07d3d4c4331f8b62b0702d067a
- name: Build the Demo Project
run: |-
cd $GITHUB_WORKSPACE
python3 lynx/tools/ios_tools/process_podfile.py --action replace_pod_version --component Lynx --version $POD_VERSION --podfile demo/ios/HelloLynxObjc/Podfile
python3 lynx/tools/ios_tools/process_podfile.py --action replace_pod_version --component LynxService --version $POD_VERSION --podfile demo/ios/HelloLynxObjc/Podfile
python3 lynx/tools/ios_tools/process_podfile.py --action replace_pod_version --component XElement --version $POD_VERSION --podfile demo/ios/HelloLynxObjc/Podfile
python3 lynx/tools/ios_tools/process_podfile.py --action insert_pod_source --podfile demo/ios/HelloLynxObjc/Podfile --pod_source "file://$GITHUB_WORKSPACE/lynx/$LOCAL_POD_NAME"
cd demo/ios/HelloLynxObjc
export LANG=en_US.UTF-8
BUNDLE_GEMFILE=$GITHUB_WORKSPACE/lynx/Gemfile bundle --version
BUNDLE_GEMFILE=$GITHUB_WORKSPACE/lynx/Gemfile bundle exec pod install
rm -rf $GITHUB_WORKSPACE/lynx/*
xcodebuild -workspace Hello-Lynx-OC.xcworkspace/ -scheme Hello-Lynx-OC CODE_SIGNING_ALLOWED=NO build
ios-e2e-test:
timeout-minutes: 60
needs: [ios-explorer-build]
env:
APPIUM_TEST_SERVER_PORT: 4723
APPIUM_TEST_SERVER_HOST: 127.0.0.1
runs-on: lynx-darwin-14-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Setup Ruby Cache
uses: ./lynx/.github/actions/ios-common-deps
with:
cache-backend: 'lynx-infra'
- name: Get iOS simulator SDK version
run: |
xcodebuild -showsdks | grep -Eo -m 1 "iphonesimulator([0-9]{1,}\.)+[0-9]{1,}" > sdk.txt
sdkVersion=$(awk '{ sub(/iphonesimulator/,""); print $0 }' sdk.txt)
echo "SDK_VERSION=$sdkVersion" >> $GITHUB_ENV
- name: Build WebDriverAgent
uses: nick-fields/retry@v3
with:
max_attempts: 2
retry_wait_seconds: 5
timeout_minutes: 5
command: |
pushd $GITHUB_WORKSPACE
git clone https://github.com/appium/WebDriverAgent.git
xcodebuild build-for-testing \
-project ./WebDriverAgent/WebDriverAgent.xcodeproj \
-scheme WebDriverAgentRunner \
-configuration Release \
-sdk iphonesimulator${{ env.SDK_VERSION }} \
-derivedDataPath ./WebDriverAgent/DerivedData \
-destination "platform=iOS Simulator,OS=${{ env.SDK_VERSION }},name=iPhone 15" \
SYMROOT=$GITHUB_WORKSPACE/Build/Products
popd
- name: Start iOS Simulator
run: |
xcrun simctl boot "iPhone 15"
- name: Install WebDriverAgent to Simulator
run: |
set -e
SIMULATOR_UDID=$(xcrun simctl list devices "iOS ${{ env.SDK_VERSION }}" | grep "iPhone 15 (" | grep -oE '[0-9A-F-]{36}')
echo "SIMULATOR_UDID=$SIMULATOR_UDID" >> $GITHUB_ENV
xcrun simctl install $SIMULATOR_UDID \
$GITHUB_WORKSPACE/Build/Products/Release-iphonesimulator/WebDriverAgentRunner-Runner.app
- name: Install Appium
run: |
pushd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pnpm install appium@2.11.2 -w
pnpm install appium-xcuitest-driver@7.24.18 -w
pnpm install appium-ios-simulator@6.2.6 -w
popd
env:
npm_config_store_dir: ~/.local/share/pnpm/store
- name: Download Explorer App
uses: lynx-infra/download-artifact@79d9914484f933089c2840552cf439bac85debad
with:
name: ios-explorer-build-arm64
path: lynx/explorer/darwin/ios/lynx_explorer/build_temp
- name: Install Explorer App
run: |
mkdir -p $GITHUB_WORKSPACE/lynx/explorer/darwin/ios/lynx_explorer/build_temp/LynxExplorer.app
tar -xzvf $GITHUB_WORKSPACE/lynx/explorer/darwin/ios/lynx_explorer/build_temp/LynxExplorer-arm64.app.tar.gz -C $GITHUB_WORKSPACE/lynx/explorer/darwin/ios/lynx_explorer/build_temp/LynxExplorer.app
xcrun simctl install $SIMULATOR_UDID $GITHUB_WORKSPACE/lynx/explorer/darwin/ios/lynx_explorer/build_temp/LynxExplorer.app
- name: Start Appium server
run: |
pushd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pushd node_modules/appium/node_modules/.bin
ls
./appium server \
--port=$APPIUM_TEST_SERVER_PORT \
--address=$APPIUM_TEST_SERVER_HOST \
--log-no-colors \
--log-timestamp \
2>&1 > "$GITHUB_WORKSPACE/lynx/appium.log" < /dev/null &
popd
popd
- name: Check if Appium Server is running
run: |
max_attempts=10
attempt=0
while [ $attempt -lt $max_attempts ]; do
if nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; then
echo "Appium Server is running."
break
else
attempt=$((attempt + 1))
echo "Attempt $attempt: Appium Server is not yet running. Retrying in 2 seconds..."
sleep 2
fi
done
if [ $attempt -eq $max_attempts ]; then
echo "Failed to start Appium Server."
exit 1
fi
- name: Run iOS E2E Test
uses: nick-fields/retry@v3
with:
max_attempts: 2
retry_wait_seconds: 5
timeout_minutes: 20
command: |
set -e
pushd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pushd $GITHUB_WORKSPACE/lynx/testing/integration_test/test_script
export server_port=$APPIUM_TEST_SERVER_PORT
export platform=ios
export APPIUM_isHeadless=True
pip3 install -r requirements.txt
python3 manage.py runtest ios_test.core
echo "TASK_STATUS=success" >> $GITHUB_OUTPUT
popd
popd
id: run_test
- name: Collect Lynx-E2E execution logs
if: always()
run: |
TASK_STATUS="${{ steps.run_test.outputs.TASK_STATUS }}"
if [ -n "$TASK_STATUS" ] && [ "$TASK_STATUS" = "success" ]; then
echo "Test execution succeeded."
else
echo "Test execution failed, collecting logs..."
pushd $GITHUB_WORKSPACE/lynx/testing/integration_test/test_script
ls | grep -E "^lynx_e2e_devtools_.*\.log$" | xargs cat
popd
fi
- name: Collect Appium Server logs
if: always()
run: |
TASK_STATUS="${{ steps.run_test.outputs.TASK_STATUS }}"
if [ -n "$TASK_STATUS" ] && [ "$TASK_STATUS" = "success" ]; then
echo "Test execution succeeded."
else
echo "Test execution failed, collecting logs..."
pushd $GITHUB_WORKSPACE/lynx/
if [ -f "appium.log" ]; then
cat appium.log
else
echo "Warning: appium.log file not found"
fi
popd
fi
- name: Collect Generated Resource Files
if: always()
run: |
TASK_STATUS="${{ steps.run_test.outputs.TASK_STATUS }}"
if [ -n "$TASK_STATUS" ] && [ "$TASK_STATUS" = "success" ]; then
echo "Test execution succeeded."
else
pushd $GITHUB_WORKSPACE/lynx/testing/integration_test/test_script
if [ -d "screenshots" ]; then
zip -r screenshots.zip ./screenshots/
echo "Successfully created screenshots.zip"
echo "ZIP_RESOURCES=success" >> $GITHUB_OUTPUT
else
echo "Warning: screenshot directory not found"
fi
fi
id: collect_resource
- name: Upload Generated Resource Files
if: always() && steps.collect_resource.outputs.ZIP_RESOURCES == 'success'
uses: lynx-infra/upload-artifact@332ec52e99f7cbf1fbbdc9bcc09280d49147d092
continue-on-error: true
with:
name: ios-e2e-resources
path: '${{ github.workspace }}/lynx/testing/integration_test/test_script/screenshots.zip'
clay-macos-build:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Build Clay Example
uses: ./lynx/.github/actions/clay-macos-build
- name: upload artifact
uses: lynx-infra/upload-artifact@332ec52e99f7cbf1fbbdc9bcc09280d49147d092
with:
name: clay_glfw
path: '${{ github.workspace }}/lynx/out/Default/clay_glfw'
macos-explorer-build:
timeout-minutes: 60
runs-on: lynx-darwin-14-medium
strategy:
matrix:
arch: [arm64, x64]
steps:
- name: Download Source
uses: actions/checkout@v4.2.2
with:
path: lynx
- name: Build macOS Explorer
uses: ./lynx/.github/actions/macos-explorer-build
with:
build-arch: ${{ matrix.arch }}
- name: upload artifact
uses: lynx-infra/upload-artifact@332ec52e99f7cbf1fbbdc9bcc09280d49147d092
with:
name: macos-explorer-build-${{ matrix.arch }}
path: '${{ github.workspace }}/lynx/LynxExplorer-macos-${{ matrix.arch }}.app.tar.gz'