[RN][GHA] Add Android Helloworld test on PR #3
Workflow file for this run
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
name: Test Android Helloworld on PR | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
jobs: | ||
test_android_helloworld: | ||
run-name: Android Helloworld: ${{ inputs.deploy_target}} by ${{ github.actor }} | ||
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/[email protected] | ||
- 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/[email protected] | ||
with: | ||
name: template-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }} | ||
path: ./app/build/outputs/apk/ | ||
compression-level: 0 | ||