Skip to content

[RN][GHA] Add Android Helloworld test on PR #5

[RN][GHA] Add Android Helloworld test on PR

[RN][GHA] Add Android Helloworld test on PR #5

Workflow file for this run

name: Test Android Helloworld on PR
on: [workflow_dispatch, pull_request, push]
jobs:
test_android_helloworld:

Check failure on line 6 in .github/workflows/android.yml

View workflow run for this annotation

GitHub Actions / Test Android Helloworld on PR

Invalid workflow file

The workflow is not valid. .github/workflows/android.yml (Line: 6, Col: 3): The workflow must contain at least one job with no dependencies.
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