Repository navigation
1176 lines (1136 loc) · 45.5 KB
/
Copy pathci.yml
File metadata and controls
1176 lines (1136 loc) · 45.5 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
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: ci
on:
pull_request:
push:
branches:
- CQ-*
- cq-*
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: lynx
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
darwin-impact-check:
runs-on: lynx-ubuntu-22.04-medium
outputs:
darwin: ${{ steps.filter.outputs.darwin }}
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
fetch-depth: 0
path: lynx
- name: Check whether Darwin jobs are affected
id: filter
run: |
set -e
if [ "${{ github.event_name }}" != "pull_request" ]; then
echo "darwin=true" >> "$GITHUB_OUTPUT"
echo "Non-PR event; run Darwin jobs."
exit 0
fi
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
if [ -z "$base" ] || echo "$base" | grep -Eq '^0+$'; then
echo "darwin=true" >> "$GITHUB_OUTPUT"
echo "Unable to determine a stable base commit; run Darwin jobs."
exit 0
fi
merge_base="$(git merge-base "$base" "$head" || true)"
if [ -z "$merge_base" ]; then
echo "darwin=true" >> "$GITHUB_OUTPUT"
echo "Unable to determine merge-base; run Darwin jobs."
exit 0
fi
git diff --name-only "$merge_base" "$head" > changed_files.txt
cat changed_files.txt
is_darwin_unaffected_path() {
local file="$1"
local pattern
while IFS= read -r pattern || [ -n "$pattern" ]; do
[ -z "$pattern" ] && continue
case "$pattern" in \#*) continue ;; esac
case "$file" in
$pattern) return 0 ;;
esac
done < .github/ci/darwin-unaffected-paths.txt
return 1
}
darwin=false
while IFS= read -r file; do
[ -z "$file" ] && continue
if ! is_darwin_unaffected_path "$file"; then
darwin=true
break
fi
done < changed_files.txt
echo "darwin=$darwin" >> "$GITHUB_OUTPUT"
echo "Darwin jobs affected: $darwin"
static-check:
runs-on: lynx-ubuntu-22.04-medium
timeout-minutes: 30
steps:
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
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:
needs: [darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
timeout-minutes: 60
runs-on: lynx-darwin-15.6.1-medium
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
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 --disable-flutter-cxx --args="enable_encode_ut=true"
linux-native-unittests-check:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
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:
needs: [darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
timeout-minutes: 60
runs-on: lynx-darwin-15.6.1-medium
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Setup CocoaPods cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
with:
path: |
~/.cocoapods/repos/trunk
~/Library/Caches/CocoaPods
key: cocoapods-ios-explorer-${{ runner.os }}-${{ hashFiles('lynx/explorer/darwin/ios/lynx_explorer/Podfile', 'lynx/explorer/darwin/ios/lynx_explorer/Podfile.flatten') }}
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Install iOS Dependencies
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4
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
SIMULATOR_ID=$(xcrun simctl list devices | grep -E "iPhone" | grep -v "unavailable" | head -1 | grep -Eo "[0-9A-F-]{36}")
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 -destination "platform=iOS Simulator,id=$SIMULATOR_ID" 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 test --id $SIMULATOR_ID --platform ios_simulator
popd
cocoapods-lynx-library-build:
timeout-minutes: 10
runs-on: lynx-ubuntu-22.04-medium
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: '3.1'
- name: Test
run: |-
cd tools/ios_tools/cocoapods-lynx-library
ruby -Itest test/autolink_test.rb
- name: Build gem
env:
RELEASE_VERSION: 0.0.1-alpha.1
run: |-
cd tools/ios_tools/cocoapods-lynx-library
export GEM_VERSION=$(ruby -e "puts Gem::Version.new(ENV.fetch('RELEASE_VERSION')).to_s")
echo "Gem version: $GEM_VERSION"
ruby <<'RUBY'
path = 'cocoapods-lynx-library.gemspec'
version = ENV.fetch('GEM_VERSION')
content = File.read(path)
updated = content.sub(/spec\.version\s*=\s*['"][^'"]+['"]/, "spec.version = '#{version}'")
abort "Unable to update #{path} version" if updated == content
File.write(path, updated)
RUBY
gem build cocoapods-lynx-library.gemspec | tee gem-build.log
gem_file=$(awk -F': ' '/File:/ {print $2}' gem-build.log | tail -n 1)
ruby -rrubygems/package -e 'spec = Gem::Package.new(ARGV.fetch(0)).spec; puts "#{spec.name} #{spec.version}"; puts spec.summary' "$gem_file"
tasm-linux-build:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
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:
needs: [darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
timeout-minutes: 60
runs-on: lynx-darwin-15.6.1-medium
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
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
node-lynx-linux-test:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
with:
target: clay
- name: Run Linux Node Lynx Tests
run: |
tools/env.sh pnpm --filter @lynx-js/node-lynx run test
- name: Install Grid Lanes Browser Oracles
run: |
tools/env.sh pnpm --filter @lynx-js/grid-lanes-conformance run install:browsers
- name: Run Grid Lanes Conformance
run: |
tools/env.sh pnpm --filter @lynx-js/grid-lanes-conformance run build
tools/env.sh pnpm --filter @lynx-js/grid-lanes-conformance run test:unit
tools/env.sh pnpm --filter @lynx-js/grid-lanes-conformance run test:calibration
tools/env.sh pnpm --filter @lynx-js/grid-lanes-conformance run test
linux-sdk-amd64-build:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
with:
target: clay
- name: Build Linux SDK
run: |
source tools/envsetup.sh
python3 platform/linux/build_release.py --target-cpu x64
- name: upload artifact
uses: lynx-infra/upload-artifact@b32caae38013b23115647b6454b17bd25e8c7466
with:
name: linux-sdk-amd64-build
path: |
${{ github.workspace }}/lynx/out/Default/lynx_sdk_linux_x64.zip
${{ github.workspace }}/lynx/out/Default/lynx_sdk_linux_x64.zip.sha256
tasm-wasm-build:
needs: [darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
timeout-minutes: 60
runs-on: lynx-darwin-15.6.1-medium
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Setup gradle cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Setup gradle cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
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
android-explorer-test:
runs-on: lynx-ubuntu-22.04-large
timeout-minutes: 60
steps:
- name: Download Source
uses: actions/checkout@v6
with:
path: lynx
- name: Python Setup
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
with:
target: sparkling
- name: Setup gradle cache
uses: lynx-infra/cache@5c6160a6a4c7fca80a2f3057bb9dfc9513fcb732
with:
path: ~/.gradle/caches/modules-2
key: gradle-android-explorer-build
- name: Test Explorer App
run: |-
cd $GITHUB_WORKSPACE/lynx
source tools/envsetup.sh
pushd explorer/android
./gradlew :LynxExplorer:testWithoutSparklingNoasanDebugUnitTest \
:LynxExplorer:testWithSparklingNoasanDebugUnitTest \
:LynxExplorer:verifySparklingAndroidRuntimeSmokeTestArtifacts \
-Penable_trace=perfetto -PabiList=x86,arm64-v8a --no-daemon -PIntegrationTest
popd
windows-explorer-build-x64:
runs-on: lynx-windows-2022-large
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Install Common Dependencies
uses: ./lynx/.github/actions/windows-common-deps
with:
target: 'clay'
- name: Build windows Explorer
uses: ./lynx/.github/actions/windows-explorer-build
with:
build-arch: x64
android-sdk-release:
timeout-minutes: 60
runs-on: lynx-ubuntu-22.04-large
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
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@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
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 zipArtifacts -Pversion=0.0.1-alpha.1
- name: upload zip artifact
uses: lynx-infra/upload-artifact@b32caae38013b23115647b6454b17bd25e8c7466
continue-on-error: true
with:
name: android-sdk-release
path: '${{ github.workspace }}/lynx/platform/android/build/lynx-android-sdk-0.0.1-alpha.1.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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
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@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
java-version: 17
distribution: 'zulu'
- name: Gradle Wrapper Cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
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@dc0e183cc7050dff1fedf646a76bbcc33e2847ac
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@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4
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 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@b32caae38013b23115647b6454b17bd25e8c7466
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
repository: lynx-family/integrating-lynx-demo-projects
ref: f8230ca6aa1c9e629e30272971d0c03450b13e8e
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 d6a90706cc0bfde92d887d666c0139cc62554ee5
git cherry-pick d6a90706cc0bfde92d887d666c0139cc62554ee5
- name: Download Lynx SDK Artifacts
uses: lynx-infra/download-artifact@dc0e183cc7050dff1fedf646a76bbcc33e2847ac
with:
name: android-sdk-release
path: lynx
- name: Python Setup
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Setup Java SDK
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
java-version: 17
distribution: 'zulu'
- name: Gradle Wrapper Cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
with:
path: ~/.gradle/wrapper/dists
key: gradle-wrapper-${{ runner.os }}
- name: Setup cache action
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
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/lynx-android-sdk-0.0.1-alpha.1.zip 0.0.1-alpha.1
./gradlew :app:assembleDebug
popd
harmony-explorer-build:
runs-on: lynx-custom-container
container:
image: ghcr.io/lynx-family/ubuntu24.04-harmony@sha256:da3d7313011f5f0e63a118197d15c005617cf3147282e77b1cd30402dcd142ac
credentials:
username: lynx-family
password: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Build Explorer App
uses: ./lynx/.github/actions/harmony-explorer-build
ios-explorer-build:
needs: [darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
timeout-minutes: 60
runs-on: lynx-darwin-15.6.1-medium
strategy:
matrix:
arch: [arm64, x86_64]
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Setup CocoaPods cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
with:
path: |
~/.cocoapods/repos/trunk
~/Library/Caches/CocoaPods
key: cocoapods-ios-explorer-${{ runner.os }}-${{ hashFiles('lynx/explorer/darwin/ios/lynx_explorer/Podfile', 'lynx/explorer/darwin/ios/lynx_explorer/Podfile.flatten') }}
- 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@b32caae38013b23115647b6454b17bd25e8c7466
continue-on-error: true
with:
name: ios-explorer-build-${{ matrix.arch }}
path: '${{ github.workspace }}/lynx/LynxExplorer-${{ matrix.arch }}.app.tar.gz'
ios-integration-test:
needs: [darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
timeout-minutes: 30
runs-on: lynx-darwin-15.6.1-medium
env:
LOCAL_POD_NAME: 'local_pod'
POD_VERSION: '0.0.1-alpha.1.${{ github.run_id }}.${{ github.run_attempt }}'
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- name: Install brew runtime dependencies
run: brew install openssl@3 readline libyaml gmp
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: '4.0.5'
- name: Prepare cocoapods publish source
run: |-
source tools/envsetup.sh
export LANG=en_US.UTF-8
bundle -v
bundle config set path .
SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk bundle install
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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: demo
repository: lynx-family/integrating-lynx-demo-projects
ref: 0ab9340e1e560f07d3d4c4331f8b62b0702d067a
- name: Setup CocoaPods cache
uses: lynx-infra/cache@d6bd70bf2182b228ff5cfa9539e5f61b0929a1ba # Node 24
with:
path: |
~/.cocoapods/repos/trunk
~/Library/Caches/CocoaPods
# This cache is for third-party pods' trunk/spec and download artifacts.
# The Podfile rewrite below only pins Lynx pods to a local source, but
# Lynx podspec transitive dependencies resolved from trunk are expected
# to stay in sync with explorer Podfile.flatten. Include that file so
# child dependency version changes also invalidate this third-party cache.
key: cocoapods-ios-integration-${{ runner.os }}-${{ hashFiles('demo/ios/HelloLynxObjc/Podfile', 'demo/ios/HelloLynxObjc/Podfile.lock', 'lynx/explorer/darwin/ios/lynx_explorer/Podfile.flatten') }}
- name: Build the Demo Project
run: |-
cd $GITHUB_WORKSPACE
export LOCAL_POD_SOURCE="file://$HOME/.cocoapods/repos/$LOCAL_POD_NAME"
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 "$LOCAL_POD_SOURCE"
python3 lynx/tools/ios_tools/process_podfile.py --action pin_pod_source --component Lynx --podfile demo/ios/HelloLynxObjc/Podfile --pod_source "$LOCAL_POD_SOURCE"
python3 lynx/tools/ios_tools/process_podfile.py --action pin_pod_source --component LynxService --podfile demo/ios/HelloLynxObjc/Podfile --pod_source "$LOCAL_POD_SOURCE"
python3 lynx/tools/ios_tools/process_podfile.py --action pin_pod_source --component XElement --podfile demo/ios/HelloLynxObjc/Podfile --pod_source "$LOCAL_POD_SOURCE"
cd demo/ios/HelloLynxObjc
export LANG=en_US.UTF-8
pod install --repo-update
rm -rf $GITHUB_WORKSPACE/lynx/* # Prevent pods and header files from depending on local resources
xcodebuild -workspace Hello-Lynx-OC.xcworkspace/ -scheme Hello-Lynx-OC CODE_SIGNING_ALLOWED=NO build
- name: Remove generated Pod caches
if: always()
run: |-
local_pod_repo="$HOME/.cocoapods/repos/$LOCAL_POD_NAME"
if [ ! -d "$local_pod_repo" ]; then
echo "Local pod repo does not exist; skipping cache cleanup: $local_pod_repo"
exit 0
fi
while IFS= read -r pod_name; do
echo "Cached versions to remove for $pod_name:"
pod cache list "$pod_name" --short || true
pod cache clean "$pod_name" --all || true
done < <(
find "$local_pod_repo" -type f -name '*.podspec.json' \
-exec basename {} .podspec.json \; | sort -u
)
ios-e2e-test:
timeout-minutes: 60
needs: [ios-explorer-build, darwin-impact-check]
if: ${{ needs.darwin-impact-check.outputs.darwin == 'true' }}
env:
APPIUM_TEST_SERVER_PORT: 4723
APPIUM_TEST_SERVER_HOST: 127.0.0.1
runs-on: lynx-darwin-15.6.1-medium
steps:
- name: Download Source
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
path: lynx
- name: Install Common Dependencies
uses: ./lynx/.github/actions/common-deps
- 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@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4
with:
max_attempts: 2
retry_wait_seconds: 5
timeout_minutes: 5
command: |
set -e
pushd $GITHUB_WORKSPACE
rm -rf WebDriverAgent
git clone --depth 1 --branch v16.9.3 https://github.com/appium/WebDriverAgent.git
test "$(git -C WebDriverAgent rev-parse HEAD)" = "54fc1a254632911fdc48e2b6fbcca2481d27d223"
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 17" \
SYMROOT=$GITHUB_WORKSPACE/Build/Products
popd