File tree 5 files changed +46
-12
lines changed
5 files changed +46
-12
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,14 @@ jobs:
22
22
- name : Build Docker image
23
23
run : docker build --tag $IMAGE_TAG .
24
24
25
+ - name : Check if Emulator (Headless) starts
26
+ run : docker run --rm -v "${GITHUB_WORKSPACE}/scripts/":/scripts $IMAGE_TAG /bin/sh -c "/scripts/test-emulator-headless.sh"
27
+
25
28
- name : Checkout React Native
26
29
uses : actions/checkout@v2
27
30
with :
28
31
repository : facebook/react-native
29
32
path : react-native
30
33
31
34
- name : Build React Native
32
- run : |
33
- docker run --rm -v "${GITHUB_WORKSPACE}/react-native/":/pwd -w /pwd $IMAGE_TAG /bin/sh -c \
34
- "yarn install && ./gradlew --no-daemon :packages:rn-tester:android:app:assembleRelease && ./scripts/circleci/buck_fetch.sh"
35
+ run : docker run --rm -v "${GITHUB_WORKSPACE}/scripts/":/scripts -v "${GITHUB_WORKSPACE}/react-native/":/react-native -w /react-native $IMAGE_TAG /bin/sh -c "/scripts/test-react-native-setup.sh"
Original file line number Diff line number Diff line change @@ -24,10 +24,16 @@ jobs:
24
24
- name : Prepare tags
25
25
env :
26
26
DOCKER_IMAGE : reactnativecommunity/react-native-android
27
+ STABLE_MAJOR : 1
27
28
id : tags
28
29
run : |
29
30
VERSION=${GITHUB_REF#refs/tags/v}
30
- echo ::set-output name=tags::"${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
31
+ MAJOR=$(echo $VERSION | cut -d'.' -f 1)
32
+ TAGS="$DOCKER_IMAGE:$VERSION,$DOCKER_IMAGE:$MAJOR"
33
+ if [[ $MAJOR == $STABLE_MAJOR ]]; then
34
+ TAGS="$TAGS,$DOCKER_IMAGE:latest"
35
+ fi
36
+ echo ::set-output name=tags::${TAGS}
31
37
32
38
- name : Build & publish to Docker Hub
33
39
uses : docker/build-push-action@v2
Original file line number Diff line number Diff line change @@ -18,28 +18,28 @@ ENV ADB_INSTALL_TIMEOUT=10
18
18
ENV ANDROID_HOME=/opt/android
19
19
ENV ANDROID_SDK_HOME=${ANDROID_HOME}
20
20
ENV ANDROID_NDK=${ANDROID_HOME}/ndk/$NDK_VERSION
21
- ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/$NDK_VERSION
22
21
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
23
22
24
23
ENV PATH=${ANDROID_NDK}:${ANDROID_HOME}/cmdline-tools/tools/bin:${ANDROID_HOME}/emulator:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:/opt/buck/bin/:${PATH}
25
24
26
25
# Install system dependencies
27
26
RUN apt update -qq && apt install -qq -y --no-install-recommends \
28
27
apt-transport-https \
29
- curl \
30
28
build-essential \
29
+ curl \
31
30
file \
32
31
git \
33
- cmake \
34
- ruby-full \
35
- openjdk-8-jdk \
36
32
gnupg2 \
37
- python \
38
- python3-distutils \
33
+ libc++1-10 \
34
+ libgl1 \
35
+ libtcmalloc-minimal4 \
36
+ openjdk-8-jdk-headless \
39
37
openssh-client \
38
+ python3 \
39
+ python3-distutils \
40
40
rsync \
41
+ tzdata \
41
42
unzip \
42
- && gem install bundler \
43
43
&& rm -rf /var/lib/apt/lists/*;
44
44
45
45
# install nodejs and yarn packages from nodesource and yarn apt sources
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ echo no | avdmanager create avd -n testEmulator -k " system-images;android-21;google_apis;armeabi-v7a"
6
+ emulator -avd testEmulator -no-audio -no-cache -no-snapshot -no-window &
7
+
8
+ echo " Waiting until the device is ready"
9
+ adb wait-for-device
10
+
11
+ echo " The device is ready"
12
+ adb shell input keyevent 82
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ echo " Check Buck setup"
6
+ ./scripts/circleci/buck_fetch.sh
7
+ buck build ReactAndroid/src/main/java/com/facebook/react
8
+ buck build ReactAndroid/src/main/java/com/facebook/react/shell
9
+
10
+ echo " Build React Native"
11
+ yarn install
12
+ ./gradlew --no-daemon :ReactAndroid:packageReactNdkLibsForBuck
13
+
14
+ echo " Assemble RNTester app"
15
+ ./gradlew --no-daemon :packages:rn-tester:android:app:assembleRelease
You can’t perform that action at this time.
0 commit comments