-
Notifications
You must be signed in to change notification settings - Fork 14
80 lines (71 loc) · 2.21 KB
/
build.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
76
77
78
79
80
name: Build
on: [ push ]
jobs:
build-swift:
name: Build with swift
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build Package with swift
run: swift build
build-xcodebuild:
name: Build with xcodebuild
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['workspace']['schemes'][0]")
echo $default | cat >default
echo Using default scheme: $default
- name: Build Package with xcodebuild
env:
scheme: ${{ 'default' }}
run: |
if [ $scheme = default ]; then scheme=$(cat default); fi
xcodebuild -scheme $scheme -destination 'platform=iOS Simulator,name=iPhone 13'
- name: Build Example
env:
scheme: ${{ 'default' }}
run: |
if [ $scheme = default ]; then scheme=$(cat default); fi
xcodebuild clean build -project Examples/ExampleUIKit/ExampleUIKit.xcodeproj -scheme $scheme -sdk iphoneos
verify_cocoapods:
name: Verify cocoapods podspec
needs: [ build-xcodebuild, build-swift ]
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Verify cocoapods
run: pod lib lint --allow-warnings
lint:
name: Running swiftlint
needs: verify_cocoapods
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install swiftlint
run: brew install swiftlint
- name: Run swiftlint
run: swiftlint