Skip to content

[EMBR-4464] Hook Swift tests up to CI #40

[EMBR-4464] Hook Swift tests up to CI

[EMBR-4464] Hook Swift tests up to CI #40

Workflow file for this run

name: packages/core/ios Unit Test
on:
pull_request:
branches:
- 5.0 # TBD update branch name
jobs:
build:
strategy:
matrix:
node-version: [18.x]
os: [macos-latest]
swift: ["5.3"]
runs-on: ${{ matrix.os }}
env:
OS: 17.5
PLATFORM: "iOS Simulator"
DEVICE: "iPhone 15 Pro"
WORKSPACE: "RNEmbraceTestProject"
SCHEME: "RNEmbraceTests"
PROJECT_PATH: packages/core/test-project
REPORT_PATH: reports/tests.json
SDK: "iphonesimulator"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Enables corepack
run: corepack enable
- name: Yarn dependencies | Global
run: yarn install --immutable
- name: Yarn dependencies | Test Project
run: |
cd ${{ env.PROJECT_PATH }}
yarn install
- name: Cache CocoaPods
id: cache-cocoapods
uses: actions/cache@v3
with:
path: |
${{ env.PROJECT_PATH }}/ios/Pods
${{ env.PROJECT_PATH }}/ios/Podfile.lock
key: ${{ runner.os }}-pods-${{ hashFiles('${{ env.PROJECT_PATH }}/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Cache Derived Data
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData
key: derived-data-${{ runner.os }}-${{ hashFiles('**/*.xcodeproj/project.pbxproj') }}-${{ hashFiles('Podfile.lock') }}
restore-keys: |
derived-data-${{ runner.os }}-
- name: Install CocoaPods
run: |
cd ${{ env.PROJECT_PATH }}/ios
pod install --verbose
if: steps.cache-cocoapods.outputs.cache-hit != 'true'
- name: Run iOS unit tests
run: |
cd ${{ env.PROJECT_PATH }}/ios
xcodebuild test \
-workspace ${{ env.WORKSPACE }}.xcworkspace \
-scheme ${{ env.SCHEME }} \
-sdk ${{ env.SDK }} \
-destination "platform=${{ env.PLATFORM }},name=${{ env.DEVICE }},OS=${{ env.OS }}" | xcbeautify
continue-on-error: false
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: unit-test-report
path: ${{ env.REPORT_PATH }}