@@ -6,6 +6,7 @@ version: 2.1
6
6
7
7
orbs :
8
8
9
+ android :
circleci/[email protected]
9
10
10
11
# -------------------------
11
12
# REFERENCES
@@ -113,7 +114,7 @@ executors:
113
114
reactnativeandroid :
114
115
<< : *defaults
115
116
docker :
116
- - image : reactnativecommunity/react-native-android:9 .0
117
+ - image : reactnativecommunity/react-native-android:v10 .0
117
118
resource_class : " xlarge"
118
119
environment :
119
120
- TERM : " dumb"
@@ -259,7 +260,7 @@ commands:
259
260
command : cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak
260
261
- restore_cache :
261
262
keys :
262
- # The committed lockfile is generated using USE_FRAMEWORKS=0 and USE_HERMES=1 so it could load an outdated cache if a change
263
+ # The committed lockfile is generated using static libraries and USE_HERMES=1 so it could load an outdated cache if a change
263
264
# only affects the frameworks or hermes config. To help prevent this also cache based on the content of Podfile.
264
265
- *pods_cache_key
265
266
- steps : << parameters.steps >>
@@ -724,6 +725,136 @@ jobs:
724
725
path : ./reports/junit
725
726
726
727
# -------------------------
728
+ # JOBS: iOS E2E Tests
729
+ # -------------------------
730
+ test_e2e_ios :
731
+ executor : reactnativeios
732
+ parameters :
733
+ ruby_version :
734
+ default : " 2.7.7"
735
+ description : The version of ruby that must be used
736
+ type : string
737
+ steps :
738
+ - checkout_code_with_cache
739
+ - run_yarn
740
+ - attach_workspace :
741
+ at : .
742
+ - run :
743
+ name : Install appium
744
+ command :
npm install [email protected] -g
745
+ - run :
746
+ name : Install appium drivers
747
+ command : |
748
+ appium driver install uiautomator2
749
+ appium driver install xcuitest
750
+ - run :
751
+ name : Start Appium server
752
+ command : appium --base-path /wd/hub
753
+ background : true
754
+ - run :
755
+ name : Start Metro
756
+ command : |
757
+ cd packages/rn-tester
758
+ yarn start
759
+ background : true
760
+ - brew_install :
761
+ package : cmake
762
+ - setup_ruby :
763
+ ruby_version : << parameters.ruby_version >>
764
+ - run :
765
+ name : Install Bundler
766
+ command : |
767
+ cd packages/rn-tester
768
+ bundle check || bundle install
769
+ bundle exec pod setup
770
+ bundle exec pod install --verbose
771
+ - run :
772
+ name : Boot iOS Simulator
773
+ command : source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
774
+ - run :
775
+ name : Build app
776
+ command : |
777
+ xcodebuild build \
778
+ -workspace packages/rn-tester/RNTesterPods.xcworkspace \
779
+ -configuration Debug \
780
+ -scheme RNTester \
781
+ -sdk iphonesimulator \
782
+ -derivedDataPath /tmp/e2e/
783
+ - run :
784
+ name : Move app to correct directory
785
+ command : mv /tmp/e2e/Build/Products/Debug-iphonesimulator/RNTester.app packages/rn-tester-e2e/apps/rn-tester.app
786
+ - run :
787
+ name : Check Appium server status
788
+ command : |
789
+ if ! nc -z 127.0.0.1 4723; then
790
+ echo Could not find Appium server!
791
+ exit 1
792
+ fi
793
+ - run :
794
+ name : Run E2E tests
795
+ command : |
796
+ cd packages/rn-tester-e2e
797
+ yarn test-ios-e2e
798
+
799
+ # -------------------------
800
+ # JOBS: Android E2E Tests
801
+ # -------------------------
802
+ test_e2e_android :
803
+ executor :
804
+ name : android/android-machine
805
+ tag : 2023.07.1
806
+ steps :
807
+ - checkout_code_with_cache
808
+ - run_yarn
809
+ - android/create-avd :
810
+ avd-name : e2e_emulator
811
+ system-image : system-images;android-33;google_apis;x86_64
812
+ install : true
813
+ - android/start-emulator :
814
+ avd-name : e2e_emulator
815
+ no-window : true
816
+ restore-gradle-cache-prefix : v1a
817
+ post-emulator-launch-assemble-command : " "
818
+ - run :
819
+ name : Install appium
820
+ command :
npm install [email protected] -g
821
+ - run :
822
+ name : Install appium drivers
823
+ command : |
824
+ appium driver install uiautomator2
825
+ appium driver install xcuitest
826
+ - run :
827
+ name : Start Appium server
828
+ command : appium --base-path /wd/hub
829
+ background : true
830
+ - run :
831
+ name : Start Metro
832
+ command : |
833
+ cd packages/rn-tester
834
+ yarn start
835
+ background : true
836
+ - attach_workspace :
837
+ at : .
838
+ - run :
839
+ name : Build app
840
+ command : |
841
+ ./gradlew :packages:rn-tester:android:app:assembleHermesDebug -PreactNativeArchitectures=x86_64
842
+ - run :
843
+ name : Move app to correct directory
844
+ command : mv packages/rn-tester/android/app/build/outputs/apk/hermes/debug/app-hermes-x86_64-debug.apk packages/rn-tester-e2e/apps/rn-tester.apk
845
+ - run :
846
+ name : Check Appium server status
847
+ command : |
848
+ if ! nc -z 127.0.0.1 4723; then
849
+ echo Could not find Appium server
850
+ exit 1
851
+ fi
852
+ - run :
853
+ name : Run E2E tests
854
+ command : |
855
+ cd packages/rn-tester-e2e
856
+ yarn test-android-e2e
857
+ # -------------------------
727
858
# JOBS: Test Android
728
859
# -------------------------
729
860
test_android :
@@ -847,7 +978,7 @@ jobs:
847
978
default : " StaticLibraries"
848
979
description : Which kind of option we want to use for `use_frameworks!`
849
980
type : enum
850
- enum : ["StaticLibraries", "StaticFrameworks", " DynamicFrameworks"]
981
+ enum : ["StaticLibraries", "DynamicFrameworks"]
851
982
ruby_version :
852
983
default : " 2.6.10"
853
984
description : The version of ruby that must be used
@@ -898,9 +1029,7 @@ jobs:
898
1029
export NO_FLIPPER=1
899
1030
fi
900
1031
901
- if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
902
- export USE_FRAMEWORKS=static
903
- elif [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
1032
+ if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
904
1033
export USE_FRAMEWORKS=dynamic
905
1034
fi
906
1035
@@ -960,9 +1089,9 @@ jobs:
960
1089
enum : ["NewArch", "OldArch"]
961
1090
use_frameworks :
962
1091
default : " StaticLibraries"
963
- description : The dependency building and linking strategy to use. Must be one of "StaticLibraries", "StaticFrameworks", " DynamicFrameworks"
1092
+ description : The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
964
1093
type : enum
965
- enum : ["StaticLibraries", "StaticFrameworks", " DynamicFrameworks"]
1094
+ enum : ["StaticLibraries", "DynamicFrameworks"]
966
1095
ruby_version :
967
1096
default : " 2.6.10"
968
1097
description : The version of ruby that must be used
@@ -997,11 +1126,6 @@ jobs:
997
1126
export USE_HERMES=0
998
1127
fi
999
1128
1000
- if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
1001
- export NO_FLIPPER=1
1002
- export USE_FRAMEWORKS=static
1003
- fi
1004
-
1005
1129
if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
1006
1130
export NO_FLIPPER=1
1007
1131
export USE_FRAMEWORKS=dynamic
@@ -1034,7 +1158,7 @@ jobs:
1034
1158
- ANDROID_HOME : " C:\\ Android\\ android-sdk"
1035
1159
- ANDROID_NDK : " C:\\ Android\\ android-sdk\\ ndk\\ 20.1.5948944"
1036
1160
- ANDROID_BUILD_VERSION : 33
1037
- - ANDROID_TOOLS_VERSION : 33.0.0
1161
+ - ANDROID_TOOLS_VERSION : 33.0.1
1038
1162
- GRADLE_OPTS : -Dorg.gradle.daemon=false
1039
1163
- CHOCO_CACHE_DIR : " C:\\ ChocoCache"
1040
1164
steps :
@@ -1653,6 +1777,9 @@ workflows:
1653
1777
run_disabled_tests : false
1654
1778
- test_android
1655
1779
- test_android_docker_image
1780
+ - test_e2e_ios :
1781
+ ruby_version : " 2.7.7"
1782
+ - test_e2e_android
1656
1783
- test_android_template :
1657
1784
requires :
1658
1785
- build_npm_package
@@ -1661,13 +1788,6 @@ workflows:
1661
1788
architecture : ["NewArch", "OldArch"]
1662
1789
jsengine : ["Hermes", "JSC"]
1663
1790
flavor : ["Debug", "Release"]
1664
- - test_ios_template :
1665
- requires :
1666
- - build_npm_package
1667
- name : " Test Template with Ruby 2.7.7"
1668
- ruby_version : " 2.7.7"
1669
- architecture : " NewArch"
1670
- flavor : " Debug"
1671
1791
- test_ios_template :
1672
1792
requires :
1673
1793
- build_npm_package
@@ -1684,18 +1804,13 @@ workflows:
1684
1804
flavor : ["Debug", "Release"]
1685
1805
jsengine : ["Hermes", "JSC"]
1686
1806
flipper : ["WithFlipper", "WithoutFlipper"]
1687
- use_frameworks : ["StaticLibraries", "StaticFrameworks", " DynamicFrameworks"]
1807
+ use_frameworks : ["StaticLibraries", "DynamicFrameworks"]
1688
1808
exclude :
1689
1809
- architecture : " NewArch"
1690
1810
flavor : " Release"
1691
1811
jsengine : " Hermes"
1692
1812
flipper : " WithFlipper"
1693
1813
use_frameworks : " StaticLibraries"
1694
- - architecture : " NewArch"
1695
- flavor : " Release"
1696
- jsengine : " Hermes"
1697
- flipper : " WithFlipper"
1698
- use_frameworks : " StaticFrameworks"
1699
1814
- architecture : " NewArch"
1700
1815
flavor : " Release"
1701
1816
jsengine : " Hermes"
@@ -1706,11 +1821,6 @@ workflows:
1706
1821
jsengine : " JSC"
1707
1822
flipper : " WithFlipper"
1708
1823
use_frameworks : " StaticLibraries"
1709
- - architecture : " NewArch"
1710
- flavor : " Release"
1711
- jsengine : " JSC"
1712
- flipper : " WithFlipper"
1713
- use_frameworks : " StaticFrameworks"
1714
1824
- architecture : " NewArch"
1715
1825
flavor : " Release"
1716
1826
jsengine : " JSC"
@@ -1721,11 +1831,6 @@ workflows:
1721
1831
jsengine : " Hermes"
1722
1832
flipper : " WithFlipper"
1723
1833
use_frameworks : " StaticLibraries"
1724
- - architecture : " OldArch"
1725
- flavor : " Release"
1726
- jsengine : " Hermes"
1727
- flipper : " WithFlipper"
1728
- use_frameworks : " StaticFrameworks"
1729
1834
- architecture : " OldArch"
1730
1835
flavor : " Release"
1731
1836
jsengine : " Hermes"
@@ -1736,36 +1841,11 @@ workflows:
1736
1841
jsengine : " JSC"
1737
1842
flipper : " WithFlipper"
1738
1843
use_frameworks : " StaticLibraries"
1739
- - architecture : " OldArch"
1740
- flavor : " Release"
1741
- jsengine : " JSC"
1742
- flipper : " WithFlipper"
1743
- use_frameworks : " StaticFrameworks"
1744
1844
- architecture : " OldArch"
1745
1845
flavor : " Release"
1746
1846
jsengine : " JSC"
1747
1847
flipper : " WithFlipper"
1748
1848
use_frameworks : " DynamicFrameworks"
1749
- - architecture : " NewArch"
1750
- flavor : " Debug"
1751
- jsengine : " Hermes"
1752
- flipper : " WithFlipper"
1753
- use_frameworks : " StaticFrameworks"
1754
- - architecture : " NewArch"
1755
- flavor : " Debug"
1756
- jsengine : " JSC"
1757
- flipper : " WithFlipper"
1758
- use_frameworks : " StaticFrameworks"
1759
- - architecture : " OldArch"
1760
- flavor : " Debug"
1761
- jsengine : " Hermes"
1762
- flipper : " WithFlipper"
1763
- use_frameworks : " StaticFrameworks"
1764
- - architecture : " OldArch"
1765
- flavor : " Debug"
1766
- jsengine : " JSC"
1767
- flipper : " WithFlipper"
1768
- use_frameworks : " StaticFrameworks"
1769
1849
- architecture : " NewArch"
1770
1850
flavor : " Debug"
1771
1851
jsengine : " Hermes"
@@ -1786,12 +1866,6 @@ workflows:
1786
1866
jsengine : " JSC"
1787
1867
flipper : " WithFlipper"
1788
1868
use_frameworks : " DynamicFrameworks"
1789
- - test_ios_rntester :
1790
- requires :
1791
- - build_hermes_macos
1792
- name : " Test RNTester with Ruby 2.7.7"
1793
- ruby_version : " 2.7.7"
1794
- architecture : " NewArch"
1795
1869
- test_ios_rntester :
1796
1870
requires :
1797
1871
- build_hermes_macos
@@ -1805,13 +1879,7 @@ workflows:
1805
1879
parameters :
1806
1880
architecture : ["NewArch", "OldArch"]
1807
1881
jsengine : ["Hermes", "JSC"]
1808
- use_frameworks : ["StaticLibraries", "StaticFrameworks", "DynamicFrameworks"]
1809
- - test_ios :
1810
- name : " Test iOS with Ruby 2.7.7"
1811
- run_unit_tests : true
1812
- requires :
1813
- - build_hermes_macos
1814
- ruby_version : " 2.7.7"
1882
+ use_frameworks : ["StaticLibraries", "DynamicFrameworks"]
1815
1883
- test_ios :
1816
1884
name : " Test iOS with Ruby 3.2.0"
1817
1885
run_unit_tests : true
0 commit comments