Skip to content

Commit 9e84f67

Browse files
committed
chore(ci): android, build bullet3 once & reuse
1 parent a316150 commit 9e84f67

1 file changed

Lines changed: 49 additions & 11 deletions

File tree

.github/workflows/build-android.yml

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,52 @@ on:
2020
- 'bun.lock'
2121

2222
jobs:
23+
build-bullet3:
24+
name: Build bullet3 for Android
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
submodules: recursive
30+
31+
- name: Setup Bun
32+
uses: oven-sh/setup-bun@v2
33+
with:
34+
bun-version: latest
35+
36+
- name: Setup Android SDK
37+
uses: android-actions/setup-android@v3
38+
39+
- name: Install Android NDK
40+
run: |
41+
sdkmanager --install "ndk;27.1.12297006"
42+
43+
# - name: Restore bun cache
44+
# uses: actions/cache@v4
45+
# with:
46+
# path: ~/.bun/install/cache
47+
# key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
48+
# restore-keys: |
49+
# ${{ runner.os }}-bun-
50+
51+
# - name: Install dependencies
52+
# run: bun install --frozen-lockfile
53+
54+
- name: Build bullet3
55+
working-directory: package/
56+
run: bun build-bullet3 --platform android
57+
58+
- name: Upload bullet3 libraries
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: bullet3-android
62+
path: package/android/libs/bullet3/
63+
retention-days: 1
64+
2365
build:
2466
name: Build ${{ matrix.app }} (${{ matrix.variant }})
2567
runs-on: ubuntu-latest
68+
needs: build-bullet3
2669
strategy:
2770
matrix:
2871
app: [AppExampleFabric, ExpoExample]
@@ -44,13 +87,6 @@ jobs:
4487
java-version: 17
4588
java-package: jdk
4689

47-
- name: Setup Android SDK
48-
uses: android-actions/setup-android@v3
49-
50-
- name: Install Android NDK
51-
run: |
52-
sdkmanager --install "ndk;27.1.12297006"
53-
5490
- name: Restore bun cache
5591
uses: actions/cache@v4
5692
with:
@@ -62,6 +98,12 @@ jobs:
6298
- name: Install dependencies
6399
run: bun install --frozen-lockfile
64100

101+
- name: Download bullet3 libraries
102+
uses: actions/download-artifact@v4
103+
with:
104+
name: bullet3-android
105+
path: package/android/libs/bullet3/
106+
65107
- name: Restore Gradle cache
66108
uses: actions/cache@v4
67109
with:
@@ -72,10 +114,6 @@ jobs:
72114
restore-keys: |
73115
${{ runner.os }}-gradle-
74116
75-
- name: Build bullet3
76-
working-directory: package/
77-
run: bun build-bullet3 --platform android
78-
79117
- name: Build Android app (AppExampleFabric)
80118
if: matrix.app == 'AppExampleFabric'
81119
working-directory: examples/AppExampleFabric/android

0 commit comments

Comments
 (0)