mirror of
https://github.com/Jellify-Music/App.git
synced 2026-03-18 03:00:35 -05:00
feat: Add APK caching to Maestro test workflow and conditionally run build steps.
This commit is contained in:
20
.github/workflows/maestro-test.yml
vendored
20
.github/workflows/maestro-test.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user