feat: Add APK caching to Maestro test workflow and conditionally run build steps.

This commit is contained in:
skalthoff
2026-01-01 23:18:37 -08:00
parent 9770d5d096
commit 1bd724985f

View File

@@ -13,16 +13,29 @@ jobs:
build-android:
if: github.repository == 'Jellify-Music/App'
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.apk-cache.outputs.cache-hit }}
steps:
- name: 🛒 Checkout
uses: actions/checkout@v6
- name: 📦 Check APK Cache
id: apk-cache
uses: actions/cache@v5
with:
path: ./android/app/build/outputs/apk/release/app-universal-release.apk
key: android-apk-${{ runner.os }}-${{ hashFiles('src/**', 'android/**', 'package.json', 'bun.lock') }}
restore-keys: |
android-apk-${{ runner.os }}-
- name: 🖥 Setup Bun
if: steps.apk-cache.outputs.cache-hit != 'true'
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.4
- name: 📦 Cache node_modules
if: steps.apk-cache.outputs.cache-hit != 'true'
uses: actions/cache@v5
with:
path: |
@@ -33,17 +46,20 @@ jobs:
${{ runner.os }}-bun-
- name: ☕ Setup JDK 17
if: steps.apk-cache.outputs.cache-hit != 'true'
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
- name: 🐘 Setup Gradle with caching
if: steps.apk-cache.outputs.cache-hit != 'true'
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: false
- name: 📦 Cache Gradle
if: steps.apk-cache.outputs.cache-hit != 'true'
uses: actions/cache@v5
with:
path: |
@@ -54,17 +70,21 @@ jobs:
${{ runner.os }}-gradle-
- name: 📥 Install dependencies
if: steps.apk-cache.outputs.cache-hit != 'true'
run: bun i
- name: 💬 Disable OTA Updates and Enable Maestro Build
if: steps.apk-cache.outputs.cache-hit != 'true'
run: bun scripts/updateEnv.js OTA_UPDATE_ENABLED=false IS_MAESTRO_BUILD=true
- name: ✅ Validate Config Files
if: steps.apk-cache.outputs.cache-hit != 'true'
run: |
bun -p "JSON.parse(require('fs').readFileSync('telemetrydeck.json'))"
bun -p "JSON.parse(require('fs').readFileSync('glitchtip.json'))"
- name: 🚀 Build Android APK
if: steps.apk-cache.outputs.cache-hit != 'true'
run: bun run android-build
- name: 📤 Upload Android Artifacts