-
-
Notifications
You must be signed in to change notification settings - Fork 33
205 lines (193 loc) · 9.37 KB
/
swift.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Swift
on: [push, pull_request, workflow_dispatch]
env:
SPOTIFY_SWIFT_TESTING_CLIENT_ID: ${{ secrets.SPOTIFY_SWIFT_TESTING_CLIENT_ID }}
SPOTIFY_SWIFT_TESTING_CLIENT_SECRET: ${{ secrets.SPOTIFY_SWIFT_TESTING_CLIENT_SECRET }}
SPOTIFY_CLIENT_CREDENTIALS_FLOW_TOKENS_URL: ${{ secrets.SPOTIFY_CLIENT_CREDENTIALS_FLOW_TOKENS_URL }}
jobs:
test_macOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build macOS
run: |
python3 enable_testing.py true
swift build --build-tests
- name: Run tests macOS
run: |
swift test --filter "\
AuthorizationScopesTests|\
CodingAuthInfoTests|\
CodingAuthorizationCodeFlowManagerTests|\
CodingAuthorizationCodeFlowPKCEManagerTests|\
CodingClientCredentialsFlowManagerTests|\
CodingCurrentlyPlayingContextTests|\
CodingPlaybackRequestTests|\
CodingSpotifyUserTests|\
CodingTimeReferenceTests|\
CodingTrackAttributesTests|\
CursorPagingObjectPlayHistoryCodingTests|\
ExampleContentTests|\
SpotifyAPIClientCredentialsFlowAlbumsTests|\
SpotifyAPIClientCredentialsFlowArtistTests|\
SpotifyAPIClientCredentialsFlowBrowseTests|\
SpotifyAPIClientCredentialsFlowClientAuthorizationTests|\
SpotifyAPIClientCredentialsFlowEpisodeTests|\
SpotifyAPIClientCredentialsFlowErrorTests|\
SpotifyAPIClientCredentialsFlowFollowTests|\
SpotifyAPIClientCredentialsFlowProxyFollowTests|\
SpotifyAPIClientCredentialsFlowInsufficientScopeTests|\
SpotifyAPIClientCredentialsFlowMarketTests|\
SpotifyAPIClientCredentialsFlowPlaylistsTests|\
SpotifyAPIClientCredentialsFlowProxyArtistTests|\
SpotifyAPIClientCredentialsFlowProxyAuthorizationTests|\
SpotifyAPIClientCredentialsFlowProxyInsufficientScopeTests|\
SpotifyAPIClientCredentialsFlowProxyRefreshTokensConcurrentTests|\
SpotifyAPIClientCredentialsFlowRefreshTokensConcurrentTests|\
SpotifyAPIClientCredentialsFlowSearchTests|\
SpotifyAPIClientCredentialsFlowShowTests|\
SpotifyAPIClientCredentialsFlowTrackTests|\
SpotifyAPIClientCredentialsFlowUserProfileTests|\
SpotifyIdentifierTests|\
SpotifyPlayerErrorCodingTests|\
RepeatModeTests\
"
test_linux:
strategy:
max-parallel: 1
fail-fast: false
matrix:
image: ["swift:5.6", "swift:5.7", "swift:5.8", "swift:5.9", "swift:5.10"]
runs-on: ubuntu-latest
container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v2
- name: Build ${{ matrix.image }}
run: |
apt-get update && apt-get install -y python3
python3 enable_testing.py true
swift build --build-tests
- name: Run tests ${{ matrix.image }}
run: |
swift test --filter "\
AuthorizationScopesTests|\
CodingAuthInfoTests|\
CodingAuthorizationCodeFlowManagerTests|\
CodingAuthorizationCodeFlowPKCEManagerTests|\
CodingClientCredentialsFlowManagerTests|\
CodingCurrentlyPlayingContextTests|\
CodingPlaybackRequestTests|\
CodingSpotifyUserTests|\
CodingTimeReferenceTests|\
CodingTrackAttributesTests|\
CursorPagingObjectPlayHistoryCodingTests|\
ExampleContentTests|\
SpotifyAPIClientCredentialsFlowAlbumsTests|\
SpotifyAPIClientCredentialsFlowArtistTests|\
SpotifyAPIClientCredentialsFlowBrowseTests|\
SpotifyAPIClientCredentialsFlowClientAuthorizationTests|\
SpotifyAPIClientCredentialsFlowEpisodeTests|\
SpotifyAPIClientCredentialsFlowErrorTests|\
SpotifyAPIClientCredentialsFlowFollowTests|\
SpotifyAPIClientCredentialsFlowProxyFollowTests|\
SpotifyAPIClientCredentialsFlowInsufficientScopeTests|\
SpotifyAPIClientCredentialsFlowMarketTests|\
SpotifyAPIClientCredentialsFlowPlaylistsTests|\
SpotifyAPIClientCredentialsFlowProxyArtistTests|\
SpotifyAPIClientCredentialsFlowProxyAuthorizationTests|\
SpotifyAPIClientCredentialsFlowProxyInsufficientScopeTests|\
SpotifyAPIClientCredentialsFlowProxyRefreshTokensConcurrentTests|\
SpotifyAPIClientCredentialsFlowRefreshTokensConcurrentTests|\
SpotifyAPIClientCredentialsFlowSearchTests|\
SpotifyAPIClientCredentialsFlowShowTests|\
SpotifyAPIClientCredentialsFlowTrackTests|\
SpotifyAPIClientCredentialsFlowUserProfileTests|\
SpotifyIdentifierTests|\
SpotifyPlayerErrorCodingTests|\
RepeatModeTests\
"
test_other_platforms:
strategy:
max-parallel: 1
fail-fast: false
matrix:
platform: ["platform=iOS Simulator,name=iPhone 15,OS=17.0", "platform=tvOS Simulator,name=Apple TV,OS=17.0"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: configure environment variables
run: ./set_credentials.sh
- name: Build ${{ matrix.platform }}
run: |
python3 enable_testing.py true
env DEVELOPER_DIR="/Applications/Xcode_15.0.1.app" xcrun xcodebuild \
-IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" \
-derivedDataPath "$PWD/.derivedData" \
-scheme "SpotifyAPI-Package" \
-destination "${{ matrix.platform }}" \
build
- name: test ${{ matrix.platform }}
run: |
env DEVELOPER_DIR="/Applications/Xcode_15.0.1.app" xcrun xcodebuild \
-IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" \
-derivedDataPath "$PWD/.derivedData" \
-scheme "SpotifyAPI-Package" \
-destination "${{ matrix.platform }}" \
test \
-only-testing "SpotifyAPIMainTests/AuthorizationScopesTests" \
-only-testing "SpotifyAPIMainTests/CodingAuthInfoTests" \
-only-testing "SpotifyAPIMainTests/CodingAuthorizationCodeFlowManagerTests" \
-only-testing "SpotifyAPIMainTests/CodingAuthorizationCodeFlowPKCEManagerTests" \
-only-testing "SpotifyAPIMainTests/CodingClientCredentialsFlowManagerTests" \
-only-testing "SpotifyAPIMainTests/CodingCurrentlyPlayingContextTests" \
-only-testing "SpotifyAPIMainTests/CodingPlaybackRequestTests" \
-only-testing "SpotifyAPIMainTests/CodingSpotifyUserTests" \
-only-testing "SpotifyAPIMainTests/CodingTimeReferenceTests" \
-only-testing "SpotifyAPIMainTests/CodingTrackAttributesTests" \
-only-testing "SpotifyAPIMainTests/CursorPagingObjectPlayHistoryCodingTests" \
-only-testing "SpotifyAPIMainTests/ExampleContentTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowAlbumsTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowArtistTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowBrowseTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowClientAuthorizationTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowEpisodeTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowErrorTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowFollowTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowInsufficientScopeTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowMarketTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowPlaylistsTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowProxyArtistTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowProxyAuthorizationTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowProxyInsufficientScopeTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowProxyRefreshTokensConcurrentTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowRefreshTokensConcurrentTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowSearchTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowShowTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowTrackTests" \
-only-testing "SpotifyAPIMainTests/SpotifyAPIClientCredentialsFlowUserProfileTests" \
-only-testing "SpotifyAPIMainTests/SpotifyIdentifierTests" \
-only-testing "SpotifyAPIMainTests/SpotifyPlayerErrorCodingTests" \
-only-testing "SpotifyAPIMainTests/RepeatModeTests"
build_watch_os_mac_catalyst:
strategy:
matrix:
platform: ["platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=10.0", "platform=macOS,variant=Mac Catalyst"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: build ${{ matrix.platform }}
run: |
env DEVELOPER_DIR="/Applications/Xcode_15.0.1.app" xcrun xcodebuild \
-IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" \
-derivedDataPath "$PWD/.derivedData" build \
-scheme "SpotifyAPI" \
-destination "${{ matrix.platform }}"
build_spotify_api_server:
runs-on: ubuntu-latest
steps:
- name: build
run: |
git clone https://github.com/Peter-Schorn/SpotifyAPIServer.git
cd SpotifyAPIServer
swift package edit SpotifyAPI --revision $GITHUB_SHA
swift build -Xswiftc -warnings-as-errors