Skip to content

[CI] fix tests and change iOS CI/CD #2

[CI] fix tests and change iOS CI/CD

[CI] fix tests and change iOS CI/CD #2

Workflow file for this run

name: CI iOS
on: [push, pull_request]
jobs:
build-and-test:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Install CocoaPods
run: gem install cocoapods
- name: Install pod dependencies
working-directory: ./Example
run: pod install || pod install --repo-update
- name: Run tests with coverage
working-directory: ./Example
run: |
xcodebuild \
-workspace RIBs.xcworkspace \
-scheme RIBs-Example \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.2' \
-enableCodeCoverage YES \
clean test
- name: Extract and print coverage
run: |
RESULT_BUNDLE=$(find ~/Library/Developer/Xcode/DerivedData -type d -name "*.xcresult" | sort | tail -n 1)
echo "Found result bundle at: $RESULT_BUNDLE"
xcrun xccov view --report --json "$RESULT_BUNDLE" > coverage.json
cat coverage.json
xcrun xccov view --report "$RESULT_BUNDLE"
- name: Lint podspec
run: |
pod lib lint RIBs.podspec \
--skip-tests