Release/2.1.1 #206
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: e2e-ios | |
on: | |
pull_request: | |
jobs: | |
e2e: | |
runs-on: macos-12 | |
timeout-minutes: 60 | |
env: | |
TURBO_CACHE_DIR: .turbo/ios-e2e | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: setup-cocoapods | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
version: 1.15.2 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Cache turborepo for iOS | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.TURBO_CACHE_DIR }} | |
key: ${{ runner.os }}-turborepo-e2e-ios-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-turborepo-e2e-ios- | |
- name: Check turborepo cache for iOS | |
run: | | |
TURBO_CACHE_STATUS=$(node -p "($(yarn --silent turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status") | |
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | |
echo "turbo_cache_hit=1" >> $GITHUB_ENV | |
fi | |
# -- Micro -- | |
- name: Cache Micro | |
id: cache-micro | |
uses: actions/cache@v3 | |
with: | |
path: micro.jar | |
key: ${{ runner.os }}-micro | |
- name: Get micro | |
if: steps.cache-micro.outputs.cache-hit != 'true' | |
run: curl -o micro.jar -L https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.7.2/snowplow-micro-1.7.2.jar | |
- name: Run Micro in background | |
run: java -jar micro.jar & | |
- name: Wait on Micro endpoint | |
timeout-minutes: 2 | |
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done | |
- name: Prepare example for Micro | |
working-directory: example/src | |
run: perl -i -pe "s/^.*collectorEndpoint =\K.*/ \'http:\/\/0.0.0.0:9090\'\;/" App.js | |
# -- Simulator -- | |
- name: Install applesimutils | |
run: | | |
brew tap wix/brew | |
brew install applesimutils | |
# -- Bootstrap -- | |
- name: Bootstrap project | |
run: | | |
yarn turbo run bootstrap --cache-dir="${{ env.TURBO_CACHE_DIR }}" | |
# -- Test -- | |
- name: Detox Jest ios | |
id: dj | |
run: | | |
yarn turbo run e2e:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" | |
- name: Log events if Detox-Jest failed | |
id: eventlog | |
if: ${{ failure() && steps.dj.outcome == 'failure' }} | |
run: | | |
echo "{ \"all\": $(curl -s -o - 'http://0.0.0.0:9090/micro/all'), \ | |
\"bad\": $(curl -s -o - 'http://0.0.0.0:9090/micro/bad'), \ | |
\"good\": $(curl -s -o - 'http://0.0.0.0:9090/micro/good') }"\ | |
| jq '.' > ios-events-micro.json | |
- name: Upload events artifact if Detox-Jest failed | |
if: ${{ failure() && steps.dj.outcome == 'failure' && steps.eventlog.outcome == 'success' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ios-events-artifact | |
path: ios-events-micro.json |