Skip to content

Commit 3d0bb20

Browse files
committed
[RN][GHA] Add Android Helloworld test on PR
Will run test_android_helloworld when users create a PR, to provide coverage while we figure out what's going on with our CircleCI tests / deprecate them. Changelog: [Internal]
1 parent 5df5ed1 commit 3d0bb20

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

.github/workflows/android.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Test Android Helloworld on PR
2+
3+
on: [workflow_dispatch, pull_request, push]
4+
5+
jobs:
6+
test_android_helloworld:
7+
runs-on: ubuntu-latest
8+
needs: prepare_hermes_workspace
9+
container:
10+
image: reactnativecommunity/react-native-android:latest
11+
env:
12+
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in conatiners
13+
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127
14+
LC_ALL: C.UTF8
15+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
16+
TERM: "dumb"
17+
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
18+
TARGET_ARCHITECTURE: "arm64-v8a"
19+
continue-on-error: true
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
flavor: [Debug, Release]
24+
architecture: [NewArch, OldArch]
25+
jsengine: [Hermes, JSC]
26+
steps:
27+
- name: Checkout
28+
uses: actions/[email protected]
29+
- name: Cache setup
30+
id: cache_setup
31+
uses: ./.github/actions/cache_setup
32+
with:
33+
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
34+
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
35+
- name: Run yarn
36+
shell: bash
37+
run: yarn install --non-interactive
38+
- name: Setup gradle
39+
uses: ./.github/actions/setup-gradle
40+
- name: Build CodeGen JS scripts
41+
shell: bash
42+
run: |
43+
cd packages/react-native-codegen
44+
yarn run build
45+
- name: Monitor Disk utilization (before build)
46+
shell: bash
47+
if: always()
48+
run: |
49+
echo "On Runner:"
50+
df -h
51+
echo "Root:"
52+
du -hs *
53+
echo "Projects folder:"
54+
du -hs ./packages/*
55+
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine.
56+
shell: bash
57+
run: |
58+
cd packages/helloworld/android
59+
args=()
60+
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
61+
args+=(--arch old)
62+
fi
63+
if [[ ${{ matrix.jsengine }} == "JSC" ]]; then
64+
args+=(--jsvm jsc)
65+
fi
66+
if [[ ${{ matrix.flavor }} == "Release" ]]; then
67+
args+=(--prod)
68+
fi
69+
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE"
70+
- name: Monitor Disk utilization (after build)
71+
shell: bash
72+
if: always()
73+
run: |
74+
echo "On Runner:"
75+
df -h
76+
echo "Root:"
77+
du -hs *
78+
echo "Projects folder:"
79+
du -hs ./packages/*
80+
- name: Upload artifact
81+
uses: actions/[email protected]
82+
with:
83+
name: template-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }}
84+
path: ./app/build/outputs/apk/
85+
compression-level: 0
86+

0 commit comments

Comments
 (0)