Skip to content

Commit

Permalink
feat: Create build Android CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Sep 13, 2024
1 parent 7eb21cc commit 9749bb4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Android

on:
push:
branches:
- main
paths:
- '.github/workflows/build-android.yml'
- 'example/android'
- 'packages/react-native-nitro-image/nitrogen'
- 'packages/react-native-nitro-image/cpp'
- 'packages/react-native-nitro-image/android'
- 'packages/react-native-nitro-modules/cpp'
- 'packages/react-native-nitro-modules/android'
- '**/bun.lockb'
- '**/react-native.config.js'
- '**/nitro.json'
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'example/android'
- 'packages/react-native-nitro-image/nitrogen'
- 'packages/react-native-nitro-image/cpp'
- 'packages/react-native-nitro-image/android'
- 'packages/react-native-nitro-modules/cpp'
- 'packages/react-native-nitro-modules/android'
- '**/bun.lockb'
- '**/react-native.config.js'
- '**/nitro.json'

jobs:
build:
name: Build Android Example App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install --frozen-lockfile

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
java-package: jdk

- name: Restore Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
run: cd example/android && ./gradlew assembleDebug --no-daemon --build-cache && cd ../..

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
run: cd android && ./gradlew --stop
4 changes: 4 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- 'packages/react-native-nitro-modules/ios'
- '**/Podfile.lock'
- '**/*.podspec'
- '**/react-native.config.js'
- '**/nitro.json'
pull_request:
paths:
- '.github/workflows/build-ios.yml'
Expand All @@ -25,6 +27,8 @@ on:
- 'packages/react-native-nitro-modules/ios'
- '**/Podfile.lock'
- '**/*.podspec'
- '**/react-native.config.js'
- '**/nitro.json'

jobs:
build:
Expand Down

0 comments on commit 9749bb4

Please sign in to comment.