Skip to content

Commit 63e86ab

Browse files
fix: streamline caching steps in Android and iOS workflows by removing unnecessary cache checks
1 parent 4da2999 commit 63e86ab

File tree

2 files changed

+10
-35
lines changed

2 files changed

+10
-35
lines changed

.github/workflows/android.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,17 @@ jobs:
3838
sudo udevadm trigger --name-match=kvm
3939
ls /dev/kvm
4040
41-
# Check caches first
42-
- name: Cache APK build output
43-
id: cache-apk
44-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
45-
with:
46-
path: example/android/app/build/outputs/apk/debug/app-debug.apk
47-
key: ${{ runner.os }}-apk-${{ hashFiles('android/**/*.{java,kt,xml,gradle}', 'example/android/**/*.{java,kt,xml,gradle}', 'package.json', 'yarn.lock', '.github/workflows/android.yml') }}
48-
49-
- name: AVD cache
50-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
51-
id: avd-cache
52-
with:
53-
path: |
54-
~/.android/avd/*
55-
~/.android/adb*
56-
key: avd-${{ env.DEVICE_API_LEVEL }}-${{ env.DEVICE_ARCH }}
57-
5841
# Build dependencies (only if APK not cached)
5942
- name: Cache NDK
60-
id: cache-ndk
61-
if: steps.cache-apk.outputs.cache-hit != 'true'
6243
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
6344
with:
6445
path: /usr/local/lib/android/sdk/ndk/27.3.13750724
6546
key: ${{ runner.os }}-ndk-27.3.13750724
6647

6748
- name: Install NDK
68-
if: steps.cache-apk.outputs.cache-hit != 'true' && steps.cache-ndk.outputs.cache-hit != 'true'
6949
run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.3.13750724"
7050

7151
- name: Cache Gradle
72-
if: steps.cache-apk.outputs.cache-hit != 'true'
7352
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
7453
with:
7554
path: |
@@ -78,19 +57,25 @@ jobs:
7857
example/android/.gradle
7958
example/android/app/.cxx
8059
example/android/app/build/intermediates
81-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'android/build.gradle', 'example/android/app/build.gradle', '.github/workflows/android.yml') }}
60+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'android/build.gradle', 'example/android/app/build.gradle') }}
8261
restore-keys: |
8362
${{ runner.os }}-gradle-
8463
8564
# Build APK (only if not cached)
8665
- name: Build APK with Gradle
87-
if: steps.cache-apk.outputs.cache-hit != 'true'
8866
working-directory: example
8967
run: yarn app:package:android
9068

69+
- name: AVD cache
70+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
71+
with:
72+
path: |
73+
~/.android/avd/*
74+
~/.android/adb*
75+
key: avd-${{ env.DEVICE_API_LEVEL }}-${{ env.DEVICE_ARCH }}
76+
9177
# Create AVD (only if not cached, runs after build)
9278
- name: Create AVD and generate snapshot for caching
93-
if: steps.avd-cache.outputs.cache-hit != 'true'
9479
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b
9580
with:
9681
api-level: ${{ env.DEVICE_API_LEVEL }}

.github/workflows/ios.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,19 @@ jobs:
3333
bundler-cache: true
3434
working-directory: example
3535

36-
# Check if app is cached
37-
- name: Cache iOS build artifacts
38-
id: cache-ios-app
39-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
40-
with:
41-
path: example/ios/build/Build/Products/Debug-iphonesimulator/MendixNativeExample.app
42-
key: ios-app-${{ runner.os }}-${{ hashFiles('example/ios/Podfile.lock', 'example/ios/MendixNativeExample/**/*.swift', 'example/ios/*.h', 'ios/**/*.{swift,h,m,mm}', 'package.json', 'yarn.lock', '.github/workflows/ios.yml') }}
43-
4436
# Build dependencies (only if app not cached)
4537
- name: Cache CocoaPods
46-
if: steps.cache-ios-app.outputs.cache-hit != 'true'
4738
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
4839
with:
4940
path: |
5041
example/ios/Pods
5142
~/Library/Caches/CocoaPods
5243
~/.cocoapods
53-
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock', '.github/workflows/ios.yml') }}
44+
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
5445
restore-keys: |
5546
${{ runner.os }}-pods-
5647
5748
- name: Install CocoaPods
58-
if: steps.cache-ios-app.outputs.cache-hit != 'true'
5949
working-directory: example
6050
run: yarn pod
6151

0 commit comments

Comments
 (0)