From 3e8c3116518087e4783b3b01ba49497e8b9ad4bb Mon Sep 17 00:00:00 2001 From: Loren Posen Date: Wed, 16 Oct 2024 19:27:55 -0700 Subject: [PATCH] Add e2e-iOS workflow for Detox testing on macOS --- .github/workflows/e2e.yml | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 000000000..647986350 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,70 @@ +# .github/workflows/e2e-ios.yml +name: e2e-ios +on: push + +jobs: + e2e-ios: + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Install macOS dependencies + run: | + brew tap wix/brew + brew install applesimutils + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Example App Yarn install + run: | + cd example + yarn install --frozen-lockfile + cd .. + + - name: Cache CocoaPods + id: cache-cocoapods + uses: actions/cache@v3 + with: + path: example/ios/Pods + key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + + - name: Install CocoaPods + if: steps.cache-cocoapods.outputs.cache-hit != 'true' + run: cd example/ios ; pod install ; cd - + + - name: Detox rebuild framework cache + run: cd example ; yarn detox rebuild-framework-cache ; cd - + + - name: Cache Detox build + id: cache-detox-build + uses: actions/cache@v3 + with: + path: example/ios/build + key: ${{ runner.os }}-detox-build + restore-keys: | + ${{ runner.os }}-detox-build + + - name: Detox build + run: cd example ; yarn detox build --configuration ios.sim.release ; cd - + + - name: Detox test + run: cd example ; yarn detox test --configuration ios.sim.release --cleanup --headless --record-logs all ; cd - + + - name: Upload artifacts + if: failure() + uses: actions/upload-artifact@v3 + with: + name: detox-artifacts + path: example/artifacts \ No newline at end of file