-
Notifications
You must be signed in to change notification settings - Fork 263
50 lines (47 loc) · 2.01 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: iOS CI
on:
pull_request:
branches:
- '**'
paths-ignore:
- '.github/**'
- 'README.md'
jobs:
build:
name: Build and Test using any available iPhone simulator
runs-on: macos-latest-large
steps:
- name: Select Xcode Version
run: |
sudo xcode-select -s /Applications/Xcode_15.2.app
- name: Checkout OneSignal-iOS-SDK
uses: actions/checkout@v3
- name: Set Default Scheme
run: |
default="UnitTestApp"
echo $default | cat >default
echo Using default scheme: $default
- name: Run Swift Lint
run: |
swiftlint
- name: Build
env:
scheme: ${{ 'UnitTestApp' }}
platform: ${{ 'iOS Simulator' }}
file_to_build: ${{ 'iOS_SDK/OneSignalSDK/OneSignal.xcodeproj' }}
filetype_parameter: ${{ 'project' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"
- name: Test
env:
scheme: ${{ 'UnitTestApp' }}
test_plan: ${{ 'UnitTestApp_TestPlan_Reduced' }}
platform: ${{ 'iOS Simulator' }}
file_to_build: ${{ 'iOS_SDK/OneSignalSDK/OneSignal.xcodeproj' }}
filetype_parameter: ${{ 'project' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
xcodebuild test-without-building -scheme "$scheme" -testPlan "$test_plan" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device"