-
Notifications
You must be signed in to change notification settings - Fork 479
137 lines (111 loc) · 4.16 KB
/
ci.yml
File metadata and controls
137 lines (111 loc) · 4.16 KB
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
129
130
131
132
133
134
135
136
137
name: CI
on:
pull_request:
push:
branches:
- master
- main
workflow_dispatch:
jobs:
spm-and-parity:
name: SPM and parity
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Show toolchain
run: |
xcodebuild -version
swift --version
- name: Check upstream test parity
run: swift scripts/checkUpstreamTestParity.swift
- name: Check upstream API parity
run: swift scripts/checkUpstreamAPIParity.swift
- name: Run SwiftPM tests
run: swift test
- name: Run SwiftPM tests with Korean locale
run: LC_ALL=ko_KR.UTF-8 LANG=ko_KR.UTF-8 swift test
- name: Build release package
run: swift build -c release
- name: Check diff whitespace
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "pull_request" ]; then
git diff --check "origin/${{ github.base_ref }}...HEAD"
elif git rev-parse --verify HEAD~1 >/dev/null 2>&1; then
git diff --check HEAD~1..HEAD
else
git diff --check
fi
maintenance-scripts:
name: Maintenance scripts
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Show tool versions
run: |
swift --version
sqlite3 --version
- name: Check version consistency
run: swift scripts/checkVersionConsistency.swift
- name: Smoke test geocoding metadata updater
run: scripts/testGeocodingMetadataUpdater.sh
cocoapods-lint:
name: CocoaPods lint
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Show CocoaPods version
run: pod --version
- name: Lint podspecs
run: |
pod lib lint libPhoneNumber-iOS.podspec --allow-warnings
pod lib lint libPhoneNumberGeocoding.podspec --allow-warnings --include-podspecs='*.podspec'
pod lib lint libPhoneNumberShortNumber.podspec --allow-warnings --include-podspecs='*.podspec'
pod lib lint libPhoneNumber-iOS-SwiftCore.podspec --allow-warnings --include-podspecs='*.podspec'
pod lib lint libPhoneNumber-iOS-SwiftGeocoding.podspec --allow-warnings --include-podspecs='*.podspec'
pod lib lint libPhoneNumber-iOS-SwiftShortNumber.podspec --allow-warnings --include-podspecs='*.podspec'
pod lib lint libPhoneNumber-iOS-SwiftUI.podspec --allow-warnings --include-podspecs='*.podspec'
pod lib lint libPhoneNumber-iOS-Swift.podspec --allow-warnings --include-podspecs='*.podspec'
xcode-schemes:
name: Xcode schemes
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Show Xcode version
run: xcodebuild -version
- name: Select available iPhone simulator
id: simulator
run: |
set -euo pipefail
udid="$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ { print $2; exit }')"
if [ -z "$udid" ]; then
echo "No available iPhone simulator found." >&2
xcrun simctl list devices available >&2
exit 1
fi
echo "udid=$udid" >> "$GITHUB_OUTPUT"
echo "Selected simulator: $udid"
- name: Test libPhoneNumber scheme
run: |
xcodebuild test \
-scheme libPhoneNumber \
-destination "id=${{ steps.simulator.outputs.udid }}" \
-derivedDataPath /tmp/libphone-xc-libphonenumber-dd
- name: Test libPhoneNumberGeocoding scheme
run: |
xcodebuild test \
-scheme libPhoneNumberGeocoding \
-destination "id=${{ steps.simulator.outputs.udid }}" \
-derivedDataPath /tmp/libphone-xc-geocoding-dd
- name: Test libPhoneNumberShortNumber scheme
run: |
xcodebuild test \
-scheme libPhoneNumberShortNumber \
-destination "id=${{ steps.simulator.outputs.udid }}" \
-derivedDataPath /tmp/libphone-xc-shortnumber-dd