Skip to content

Commit

Permalink
Enhance CI configuration for Detox testing on iOS and update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lposen committed Oct 17, 2024
1 parent 7164c6f commit 8dcc21a
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 17 deletions.
103 changes: 94 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
# Tests should be moved here in the future.
# # Tests should be moved here in the future.
# version: 2.1

# references:
# machine_config: &machine_config
# machine:
# image: default

# defaults: &defaults
# resource_class: large
# working_directory: ~/react-native-sdk
# docker:
# - image: cimg/node:20.10

# orbs:
# node: circleci/node@6.3.0
# android: circleci/android@3.0.0
# rn: react-native-community/react-native@8.0.0
# ruby: circleci/ruby@2.2.1

# jobs:
# install:
# <<: *defaults
# steps:
# - checkout
# workflows:
# build:
# jobs:
# - install

version: 2.1

orbs:
node: circleci/node@6.3.0

references:
machine_config: &machine_config
machine:
Expand All @@ -12,18 +44,71 @@ references:
docker:
- image: cimg/node:20.10

orbs:
node: circleci/node@6.3.0
android: circleci/android@3.0.0
rn: react-native-community/react-native@8.0.0
ruby: circleci/ruby@2.2.1
executors:
detox-executor:
macos:
xcode: "14.3.1" # Use the appropriate Xcode version for your project
working_directory: ~/react-native-sdk

jobs:
install:
detox:
<<: *defaults
executor: detox-executor
steps:
- checkout

- run:
name: Install Node.js
command: |
node -v
npm -v
- run:
name: Install Yarn
command: |
npm install -g yarn
yarn -v
- run:
name: Install Detox CLI
command: |
npm install -g detox-cli
- run:
name: Install Project Dependencies
command: |
yarn install
- run:
name: Install Example Dependencies
command: |
cd example
yarn install
cd ..
- run:
name: Install iOS Dependencies
command: |
cd example/ios
pod install
cd ../..
- run:
name: Build the App for Detox
command: |
cd example
detox build --configuration ios.sim.release
cd ..
- run:
name: Run Detox Tests
command: |
cd example
detox test --configuration ios.sim.release
cd ..
workflows:
build:
version: 2
detox-tests:
jobs:
- install
- detox
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
run: cd example ; yarn detox build --configuration ios.sim.release ; cd -

- name: Detox test
env:
ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
ITBL_ID: ${{secrets.ITBL_ID}}
run: cd example ; yarn detox test --configuration ios.sim.release --cleanup --headless --record-logs all ; cd -

- name: Upload artifacts
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Detox iOS Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [pull_request]

# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main

jobs:
detox-ios:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

[![Maintainability](https://api.codeclimate.com/v1/badges/65c0848df0b79f994139/maintainability)](https://codeclimate.com/repos/5ed53e32f0d7ef01a201bb8d/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/65c0848df0b79f994139/test_coverage)](https://codeclimate.com/repos/5ed53e32f0d7ef01a201bb8d/test_coverage)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


[Iterable](https://www.iterable.com) is a growth marketing platform that helps
Expand Down

0 comments on commit 8dcc21a

Please sign in to comment.