Skip to content

Commit

Permalink
iOS: split build and test jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-8 committed Aug 27, 2024
1 parent e102741 commit cda0d0a
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
test:
# https://github.community/t/how-to-stop-github-actions-workflow-to-trigger-when-the-pull-request-is-from-dependabot-preview/116486
if: github.actor != 'dependabot[bot]'
name: Run Android Emulator Tests
name: Run Tests on Android Emulator
needs: build
runs-on: ubuntu-latest
defaults:
Expand Down
75 changes: 68 additions & 7 deletions .github/workflows/test_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
name: E2E tests, iOS
on: [push]
jobs:
IOS_SIMULATOR_TESTS:
build:
# https://github.community/t/how-to-stop-github-actions-workflow-to-trigger-when-the-pull-request-is-from-dependabot-preview/116486
if: github.actor != 'dependabot[bot]'
name: iOS Simulator Tests
name: Build App bundle
runs-on: macOS-14
steps:
- uses: actions/checkout@v3
Expand All @@ -33,11 +33,6 @@ jobs:
- name: Install dependencies (yarn)
run: yarn install --no-progress --network-timeout 100000 --network-concurrency 1

- name: Install applesimutils
run: |
brew tap wix/brew
brew install applesimutils
- name: Configure Firebase
run: |
brew install xmlstarlet
Expand Down Expand Up @@ -86,6 +81,72 @@ jobs:
- name: Build app for Detox
run: node node_modules/.bin/detox build -c ios.sim.release

- name: Upload App bundle
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: CoopCycle.app
path: ios/build/Build/Products/Release-iphonesimulator/CoopCycle.app

test:
# https://github.community/t/how-to-stop-github-actions-workflow-to-trigger-when-the-pull-request-is-from-dependabot-preview/116486
if: github.actor != 'dependabot[bot]'
name: Run Tests on iOS Simulator
runs-on: macOS-14
steps:
- uses: actions/checkout@v3

- name: Download App bundle
uses: actions/download-artifact@v4
with:
name: CoopCycle.app
path: ios/build/Build/Products/Release-iphonesimulator

- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

- name: Install dependencies to compile node-canvas
run: brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman imagemagick

- name: Install dependencies (yarn)
run: yarn install --no-progress --network-timeout 100000 --network-concurrency 1

- name: Install applesimutils
run: |
brew tap wix/brew
brew install applesimutils
- name: Install CocoaPods plugins
run: gem install cocoapods-user-defined-build-types

- name: Cache Pods
uses: actions/cache@v2
id: cache-pods
with:
path: ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}

- name: Install Pods
working-directory: ios/
run: USE_FRAMEWORKS=static NO_FLIPPER=1 bundle exec pod install

# https://vojtastavik.com/2018/09/02/what-is-inside-derived-data-xcode/
# https://discuss.circleci.com/t/sharing-xcode-derived-data-folder-across-jobs-workflows/31363/5
# https://medium.com/@bitrise/60-faster-builds-force-xcode-to-use-caching-on-bitrise-af8979ca39a6
- name: Cache XCode derived data
uses: actions/cache@v2
id: cache-xcode-derived-data
with:
path: ios/build
key: xcode-derived-data-${{ hashFiles('**/Podfile.lock') }}

- name: Run Detox tests
run: node node_modules/.bin/detox test -c ios.sim.release --headless --loglevel info

Expand Down

0 comments on commit cda0d0a

Please sign in to comment.