Skip to content

build: configure yarn to use locally saved yarn #78

build: configure yarn to use locally saved yarn

build: configure yarn to use locally saved yarn #78

Workflow file for this run

name: Testing E2E
on:
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
- '**/*.md'
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ------------------
# Android
# ------------------
android:
name: Android
runs-on: ubuntu-latest
timeout-minutes: 70
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 50
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- uses: actions/cache@v4
name: Yarn Cache
id: yarn-cache
with:
path: |
.yarn/
example/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'example/package.json') }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
# Only write to the cache for builds on the 'main' branches, stops branches evicting main cache
# Builds on other branches will only read from main branch cache writes
# Comment this and the with: above out for performance testing on a branch
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
- name: Yarn Install
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: yarn && yarn example:prepare
- name: Configure JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- name: Build Android App
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn example:build:android
# ------------------
# iOS
# ------------------
ios:
name: iOS
runs-on: macos-latest
# TODO matrix across APIs, at least 10 and 13 (lowest to highest)
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 50
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/cache@v4
name: Yarn Cache
id: yarn-cache
with:
path: |
.yarn
example/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'example/package.json') }}
- uses: actions/cache@v4
name: Cache Pods
with:
path: |
example/ios/Pods
example/macos/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock', 'example/macos/Podfile.lock') }}
# Detox is compiled during yarn install, using Xcode, set up cache first
- uses: hendrikmuhs/ccache-action@v1
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-v2 # makes a unique key w/related restore key internally
create-symlink: true
max-size: 750M
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3
- name: Update Ruby build tools
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
retry_wait_seconds: 60
max_attempts: 3
command: gem update cocoapods xcodeproj
- name: Update brew build tools
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: brew install xcbeautify
- name: Yarn and Pod Install
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: yarn && yarn example:prepare
- name: Build iOS App
run: |
yarn example:build:ios