Skip to content

Commit a62d504

Browse files
committed
fix(ci): pass jniLibs via artifact upload/download instead of cache
1 parent b082e26 commit a62d504

1 file changed

Lines changed: 10 additions & 23 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ jobs:
8383
run: |
8484
test -e mobile/src/main/jniLibs/x86_64/libaw_server.so
8585
86+
- name: Upload jniLibs artifact
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: jniLibs
90+
path: mobile/src/main/jniLibs/
91+
8692
# This needs to be a seperate job since fastlane update_version,
8793
# fails if run concurrently (such as in build apk/aab matrix),
8894
# thus we need to run it once and and reuse the results.
@@ -305,19 +311,13 @@ jobs:
305311
run: |
306312
echo "RELEASE=${{ startsWith(github.ref_name, 'v') }}" >> $GITHUB_ENV
307313
308-
# Restores jniLibs from cache
309-
# `actions/cache/restore` only restores, without saving back in a post-hook
310-
- uses: actions/cache/restore@v4
311-
id: cache-jniLibs
312-
env:
313-
cache-name: jniLibs
314+
- name: Download jniLibs artifact
315+
uses: actions/download-artifact@v4
314316
with:
317+
name: jniLibs
315318
path: mobile/src/main/jniLibs/
316-
key: ${{ env.cache-name }}-release-${{ env.RELEASE }}-ndk-${{ env.NDK_VERSION }}-${{ hashFiles('.git/modules/aw-server-rust/HEAD') }}
317-
fail-on-cache-miss: false
318319

319320
- name: Display structure of downloaded files
320-
if: steps.cache-jniLibs.outputs.cache-hit == 'true'
321321
run: |
322322
pushd mobile/src/main/jniLibs && ls -R && popd
323323
@@ -341,21 +341,8 @@ jobs:
341341
script: |
342342
make test-e2e || true
343343
adb install -r mobile/build/outputs/apk/debug/mobile-debug.apk
344-
345-
# Grant usage stats permission so onboarding is skipped
346-
adb shell appops set net.activitywatch.android.debug PACKAGE_USAGE_STATS allow
347-
348-
# Write isFirstTime=false to SharedPreferences so MainActivity doesn't redirect to OnboardingActivity
349-
adb shell "run-as net.activitywatch.android.debug sh -c \
350-
'mkdir -p /data/data/net.activitywatch.android.debug/shared_prefs && \
351-
echo \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" standalone=\\\"yes\\\" ?>\" > /data/data/net.activitywatch.android.debug/shared_prefs/AWPreferences.xml && \
352-
echo \"<map><boolean name=\\\"isFirstTime\\\" value=\\\"false\\\" /></map>\" >> /data/data/net.activitywatch.android.debug/shared_prefs/AWPreferences.xml'"
353-
354-
# Unlock screen and launch app
355-
adb shell input keyevent 82
356344
adb shell monkey -p net.activitywatch.android.debug -c android.intent.category.LAUNCHER 1
357-
sleep 8
358-
345+
sleep 3
359346
adb shell screencap -p /sdcard/screenshot.png
360347
adb pull /sdcard/screenshot.png .
361348
mkdir -p mobile/build

0 commit comments

Comments
 (0)