Skip to content

Commit e2daea8

Browse files
committed
[CI] fix tests and change iOS CI/CD
1 parent d9438b0 commit e2daea8

17 files changed

Lines changed: 897 additions & 61 deletions

File tree

.github/workflows/android.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/iOS.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI iOS
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-test:
7+
runs-on: macos-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: '3.1'
17+
18+
- name: Install CocoaPods
19+
run: gem install cocoapods
20+
21+
- name: Install pod dependencies
22+
working-directory: ./Example
23+
run: pod install || pod install --repo-update
24+
25+
- name: Run tests with coverage
26+
working-directory: ./Example
27+
run: |
28+
xcodebuild \
29+
-workspace RIBs.xcworkspace \
30+
-scheme RIBs-Example \
31+
-sdk iphonesimulator \
32+
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.2' \
33+
-enableCodeCoverage YES \
34+
clean test
35+
36+
- name: Extract and print coverage
37+
run: |
38+
RESULT_BUNDLE=$(find ~/Library/Developer/Xcode/DerivedData -type d -name "*.xcresult" | sort | tail -n 1)
39+
40+
echo "Found result bundle at: $RESULT_BUNDLE"
41+
42+
xcrun xccov view --report --json "$RESULT_BUNDLE" > coverage.json
43+
cat coverage.json
44+
45+
xcrun xccov view --report "$RESULT_BUNDLE"
46+
47+
- name: Lint podspec
48+
run: |
49+
pod lib lint RIBs.podspec \
50+
--skip-tests

Example/Podfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use_frameworks!
2+
3+
platform :ios, '10.0'
4+
5+
target 'RIBs_Example' do
6+
pod 'RIBs', :path => '../', :testspecs => ['Tests']
7+
8+
end

0 commit comments

Comments
 (0)