From ef9c28da32fd7c8a9ce01aba257d1848ece68481 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Fri, 16 Dec 2022 12:49:49 +0100 Subject: [PATCH] Trying to cache build folder on GitHub --- .github/workflows/android.yml | 20 ++++++++++++++++---- ci-build-cache-timestamp.txt | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 ci-build-cache-timestamp.txt diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 498eb4c95..1943451e5 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -55,6 +55,13 @@ jobs: with: path: node_modules key: node-modules-${{ hashFiles('**/package-lock.json') }} + + - name: Cache android build folder + uses: actions/cache@v3 + id: androidcache + with: + path: android/app/build + key: android-app-build-${{ hashFiles('**/ci-build-cache-timestamp.txt') }} - name: Rebuild detox from cache if: steps.cache.outputs.cache-hit == 'true' @@ -90,6 +97,7 @@ jobs: distribution: 'zulu' - name: Build for detox + if: steps.androidcache.outputs.cache-hit != 'true' run: npm run e2e:build:android - name: Android Emulator @@ -102,11 +110,15 @@ jobs: $ANDROID_HOME/platform-tools/adb devices echo "Emulator started" - - name: Reverse ADB - run: adb reverse tcp:8081 tcp:8081 - - name: Android Detox - run: npm start & npm run e2e:test:android -- --cleanup --debug-synchronization 200 + run: npm run e2e:test:android -- --cleanup --debug-synchronization 500 --take-screenshots failing --record-videos failing -l trace + + - name: Store Detox artifacts on test failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: detox-artifacts + path: artifacts # Default path for Detox artifacts notify: name: Notify Slack diff --git a/ci-build-cache-timestamp.txt b/ci-build-cache-timestamp.txt new file mode 100644 index 000000000..a54fb3ddd --- /dev/null +++ b/ci-build-cache-timestamp.txt @@ -0,0 +1 @@ +22-12-16 12:43 \ No newline at end of file