-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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]
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Test Android Helloworld on PR | ||
|
||
on: [workflow_dispatch, pull_request, push] | ||
|
||
run-name: Android Helloworld: ${{ inputs.deploy_target}} by ${{ github.actor }} | ||
|
||
jobs: | ||
test_android_helloworld: | ||
runs-on: ubuntu-latest | ||
needs: prepare_hermes_workspace | ||
container: | ||
image: reactnativecommunity/react-native-android:latest | ||
env: | ||
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in conatiners | ||
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127 | ||
LC_ALL: C.UTF8 | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
TERM: "dumb" | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false" | ||
TARGET_ARCHITECTURE: "arm64-v8a" | ||
continue-on-error: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavor: [Debug, Release] | ||
architecture: [NewArch, OldArch] | ||
jsengine: [Hermes, JSC] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4.1.1 | ||
- name: Cache setup | ||
id: cache_setup | ||
uses: ./.github/actions/cache_setup | ||
with: | ||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} | ||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} | ||
- name: Run yarn | ||
shell: bash | ||
run: yarn install --non-interactive | ||
- name: Setup gradle | ||
uses: ./.github/actions/setup-gradle | ||
- name: Build CodeGen JS scripts | ||
shell: bash | ||
run: | | ||
cd packages/react-native-codegen | ||
yarn run build | ||
- name: Monitor Disk utilization (before build) | ||
shell: bash | ||
if: always() | ||
run: | | ||
echo "On Runner:" | ||
df -h | ||
echo "Root:" | ||
du -hs * | ||
echo "Projects folder:" | ||
du -hs ./packages/* | ||
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine. | ||
shell: bash | ||
run: | | ||
cd packages/helloworld/android | ||
args=() | ||
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then | ||
args+=(--arch old) | ||
fi | ||
if [[ ${{ matrix.jsengine }} == "JSC" ]]; then | ||
args+=(--jsvm jsc) | ||
fi | ||
if [[ ${{ matrix.flavor }} == "Release" ]]; then | ||
args+=(--prod) | ||
fi | ||
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE" | ||
- name: Monitor Disk utilization (after build) | ||
shell: bash | ||
if: always() | ||
run: | | ||
echo "On Runner:" | ||
df -h | ||
echo "Root:" | ||
du -hs * | ||
echo "Projects folder:" | ||
du -hs ./packages/* | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4.3.1 | ||
with: | ||
name: template-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }} | ||
path: ./app/build/outputs/apk/ | ||
compression-level: 0 | ||
|