-
Notifications
You must be signed in to change notification settings - Fork 192
/
action.yml
75 lines (69 loc) · 2.11 KB
/
action.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: 'Run xcodebuild'
description: 'Action runs `xcodebuild build` for the scheme specified'
inputs:
scheme:
required: true
type: string
project_path:
required: false
type: string
xcode_path:
required: false
type: string
destination:
required: false
type: string
default: 'platform=iOS Simulator,name=iPhone 13,OS=latest'
sdk:
required: false
type: string
default: 'iphonesimulator'
cloned_source_packages_path:
required: false
type: string
default: ''
derived_data_path:
required: false
type: string
default: ''
disable_package_resolution:
required: false
type: boolean
default: false
other_flags:
required: false
type: string
default: ''
runs:
using: "composite"
steps:
- name: Test ${{ inputs.scheme }}
env:
SCHEME: ${{ inputs.scheme }}
PROJECT_PATH: ${{ inputs.project_path }}
XCODE_PATH: ${{ inputs.xcode_path }}
CLONED_SOURCE_PACKAGES_PATH: ${{ inputs.cloned_source_packages_path }}
DERIVED_DATA_PATH: ${{ inputs.derived_data_path }}
run: |
if [ ! -z "$PROJECT_PATH" ]; then
cd $PROJECT_PATH
fi
if [ ! -z "$XCODE_PATH" ]; then
sudo xcode-select -s $XCODE_PATH
fi
otherFlags="${{ inputs.other_flags }}"
if [ "${{ inputs.disable_package_resolution }}" == "true" ]; then
echo "Disabling Automatic Package Resolution"
otherFlags+=" -disableAutomaticPackageResolution"
fi
if [ ! -z "$DERIVED_DATA_PATH" ]; then
echo "Using custom DerivedData path"
otherFlags+=" -derivedDataPath $DERIVED_DATA_PATH"
fi
if [ ! -z "$CLONED_SOURCE_PACKAGES_PATH" ]; then
echo "Using custom cloned source packages path"
otherFlags+=" -clonedSourcePackagesDirPath $CLONED_SOURCE_PACKAGES_PATH"
fi
xcodebuild -version
xcodebuild build -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' $otherFlags | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
shell: bash