@@ -6,126 +6,14 @@ permissions:
6
6
id-token : write # This is required for aws-actions/configure-aws-credentials
7
7
8
8
on :
9
- push :
10
- branches : ['main']
11
9
schedule :
12
10
- cron : ' 0 * * * *' # Run at the first minute of every hour
13
11
14
12
jobs :
15
13
build :
16
- runs-on : macos-13
17
- environment : ci
18
- strategy :
19
- fail-fast : false
20
- matrix :
21
- framework : [react-native]
22
- framework-version : [latest]
23
- # uncomment to re-enable
24
- # build-tool: [cli, expo]
25
- build-tool : [expo]
26
- build-tool-version : [latest]
27
- pkg-manager : [npm]
28
- language : [ts]
29
- node-version : [18]
30
- platform : [ios, android]
31
- logfile : [test.log]
32
- pkg-manager-version : [latest]
33
- exclude :
34
- - build-tool : expo
35
- platform : ios
36
-
37
- env :
38
- MEGA_APP_NAME : rn${{ matrix.framework-version }}${{ matrix.build-tool }}${{ matrix.build-tool-version }}${{ matrix.language }}${{ matrix.platform }}
39
-
40
- steps :
41
- - name : Checkout Amplify UI
42
- uses : actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
43
- with :
44
- persist-credentials : false
45
- - name : Setup Node.js ${{ matrix.node-version }} with ${{ matrix.pkg-manager }}
46
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 https://github.com/actions/setup-node/commit/60edb5dd545a775178f52524783378180af0d1f8
47
- with :
48
- node-version : ${{ matrix.node-version }}
49
- cache : ${{ matrix.pkg-manager }}
50
- env :
51
- SEGMENT_DOWNLOAD_TIMEOUT_MINS : 2
52
-
53
- - name : Restore CocoaPods cache
54
- if : ${{ matrix.platform == 'ios' }}
55
- id : restore-cocoapods-cache
56
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 https://github.com/actions/cache/commit/0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
57
- with :
58
- path : ./examples/react-native/ios/Pods
59
- key : ${{ runner.os }}-cocoapods-${{ inputs.commit }}
60
- restore-keys : pods-${{ hashFiles('examples/react-native/ios/Podfile.lock') }}
61
- env :
62
- SEGMENT_DOWNLOAD_TIMEOUT_MINS : 1
63
- - name : Restore node_modules cache
64
- if : ${{ matrix.platform == 'ios' }}
65
- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 https://github.com/actions/cache/commit/0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
66
- id : restore-cache
67
- with :
68
- path : |
69
- ./node_modules
70
- **/node_modules
71
- key : ${{ runner.os }}-nodemodules-${{ inputs.commit }}
72
- env :
73
- SEGMENT_DOWNLOAD_TIMEOUT_MINS : 3
74
- - name : Install Java 17
75
- if : ${{ matrix.platform == 'android' }}
76
- uses : actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # 3.6.0
77
- with :
78
- distribution : ' corretto' # Amazon Corretto Build of OpenJDK
79
- java-version : ' 17'
80
-
81
- - name : Install iOS simulator
82
- if : ${{ matrix.platform == 'ios' }}
83
- run : |
84
- brew tap wix/brew
85
- brew install applesimutils
86
- brew install watchman
87
- brew link --overwrite [email protected]
88
- echo "ruby --version"
89
- ruby --version
90
- continue-on-error : true # brew overwrite step addresses a python install issue: https://github.com/actions/runner-images/issues/8500
91
- - name : Update CocoaPods
92
- if : ${{ matrix.platform == 'ios' }}
93
- run : |
94
- gem update cocoapods xcodeproj
95
- yarn react-native-example ios:pod-install
96
-
97
- - name : Install Android emulator
98
- if : ${{ matrix.platform == 'android' }}
99
- run : |
100
- echo -e "echo \$ANDROID_HOME"
101
- echo $ANDROID_HOME
102
- $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;33.0.2' platform-tools
103
- echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-27;default;x86_64"
104
- echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd --force --name Pixel_5_API_27 --device "pixel_5" --abi x86_64 --package "system-images;android-27;default;x86_64"
105
- printf 'hw.cpu.ncore=2\n' >> ~/.android/avd/Pixel_5_API_27.avd/config.ini
106
- printf 'hw.ramSize=2048\n' >> ~/.android/avd/Pixel_5_API_27.avd/config.ini
107
- printf 'hw.heapSize=576\n' >> ~/.android/avd/Pixel_5_API_27.avd/config.ini
108
- - name : Start Android emulator
109
- if : ${{ matrix.platform == 'android' }}
110
- run : |
111
- nohup $ANDROID_HOME/emulator/emulator -avd Pixel_5_API_27 -no-boot-anim -no-audio -no-snapshot-load -gpu host -accel on &
112
- $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
113
- $ANDROID_HOME/platform-tools/adb devices
114
- # disable spell checker
115
- $ANDROID_HOME/platform-tools/adb shell settings put secure spell_checker_enabled 0
116
- # disable animations
117
- $ANDROID_HOME/platform-tools/adb shell settings put global window_animation_scale 0.0
118
- $ANDROID_HOME/platform-tools/adb shell settings put global transition_animation_scale 0.0
119
- $ANDROID_HOME/platform-tools/adb shell settings put global animator_duration_scale 0.0
120
-
121
- - name : Create MegaApp ${{ env.MEGA_APP_NAME }} and run build on NodeJS ${{ matrix.node-version }}
122
- run : npm run ${{ env.MEGA_APP_NAME }}
123
- shell : bash
124
- working-directory : build-system-tests
125
- - name : Detect Mega App Error in Log
126
- run : npm run checkReactNativeLogs -- --log-file-name ${{ matrix.logfile }} --mega-app-name ${{ env.MEGA_APP_NAME }} --platform ${{ matrix.platform }}
127
- shell : bash
128
- working-directory : build-system-tests
14
+ uses : ./.github/workflows/reusable-build-system-test-react-native.yml
15
+ with :
16
+ dist-tag : latest
129
17
130
18
log-failure-metric :
131
19
# Send a failure data point to metric BuildSystemTestFailure in github-workflows@ us-east-2
0 commit comments