This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
forked from GEOSwift/GEOSwift
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (126 loc) · 4.34 KB
/
main.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
name: GEOSwift
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
swiftlint:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Swiftlint
run: swiftlint
podspec:
name: Lint Podspec for ${{ matrix.platform }}
runs-on: macos-latest
strategy:
matrix:
platform: [ios, osx, tvos, watchos]
steps:
- uses: actions/checkout@v2
- name: Lint Podspec
run: pod lib lint --platforms=${{ matrix.platform }}
xcodebuild:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: "xcodebuild (iOS 15.2, Xcode 13.2.1)"
os: macos-11
xcode-version: "13.2.1"
sdk: iphonesimulator15.2
destination: "platform=iOS Simulator,OS=15.2,name=iPhone 13"
- name: "xcodebuild (tvOS 15.2, Xcode 13.2.1)"
os: macos-11
xcode-version: "13.2.1"
sdk: appletvsimulator15.2
destination: "platform=tvOS Simulator,OS=15.2,name=Apple TV"
- name: "xcodebuild (macOS 12.1, Xcode 13.2.1)"
os: macos-11
xcode-version: "13.2.1"
sdk: macosx12.1
destination: "platform=OS X"
- name: "xcodebuild (watchOS 8.3, Xcode 13.2.1)"
os: macos-11
xcode-version: "13.2.1"
sdk: watchos8.3
destination: "platform=watchOS Simulator,OS=8.3,name=Apple Watch Series 7 - 45mm"
- name: "xcodebuild (iOS 14.0, Xcode 12.0.1)"
os: macos-10.15
xcode-version: "12"
sdk: iphonesimulator14.0
destination: "platform=iOS Simulator,OS=14.0,name=iPhone 11"
- name: "xcodebuild (tvOS 14.0, Xcode 12.0.1)"
os: macos-10.15
xcode-version: "12"
sdk: appletvsimulator14.0
destination: "platform=tvOS Simulator,OS=14.0,name=Apple TV"
- name: "xcodebuild (macOS 10.15, Xcode 12.0.1)"
os: macos-10.15
xcode-version: "12"
sdk: macosx10.15
destination: "platform=OS X"
- name: "xcodebuild (watchOS 7.0, Xcode 12.0.1)"
os: macos-10.15
xcode-version: "12"
sdk: watchos7.0
destination: "platform=watchOS Simulator,OS=7.0,name=Apple Watch Series 6 - 44mm"
steps:
- uses: actions/checkout@v2
- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
- name: Install xcpretty
run: gem install xcpretty
- name: Build & Test
run: |
xcodebuild \
-scheme GEOSwift \
-sdk "${{ matrix.sdk }}" \
-destination "${{ matrix.destination }}" \
clean test | xcpretty -c;
swift-cli:
name: "swift-cli (${{ matrix.os }}, Swift ${{ matrix.swift }})"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
swift: "5.3"
flags: "--enable-test-discovery"
- os: ubuntu-latest
swift: "5.5"
- os: macos-10.15
xcode-version: "12"
swift: "5.3"
flags: "--enable-test-discovery"
- os: macos-11
xcode-version: "13.2.1"
swift: "5.5"
flags: "--enable-code-coverage"
upload-coverage: true
steps:
- uses: actions/checkout@v2
- uses: fwal/setup-swift@v1
if: matrix.os == 'ubuntu-latest'
with:
swift-version: ${{ matrix.swift }}
- name: Select Xcode Version
if: startsWith(matrix.os, 'macos')
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
- name: Build & Test
run: swift test ${{ matrix.flags }}
- name: Convert coverage to lcov
if: matrix.upload-coverage
run: |
xcrun llvm-cov export \
-format="lcov" \
-instr-profile "$(swift build --show-bin-path)/codecov/default.profdata" \
"$(swift build --show-bin-path)/GEOSwiftPackageTests.xctest/Contents/MacOS/GEOSwiftPackageTests" \
Sources/**/*.swift > GEOSwift.lcov
- uses: codecov/codecov-action@v2
if: matrix.upload-coverage
with:
fail_ci_if_error: true