ci.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. name: "Alamofire CI"
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - hotfix
  7. paths:
  8. - ".github/workflows/**"
  9. - "Package.swift"
  10. - "Source/**"
  11. - "Tests/**"
  12. pull_request:
  13. paths:
  14. - ".github/workflows/**"
  15. - "Package.swift"
  16. - "Source/**"
  17. - "Tests/**"
  18. concurrency:
  19. group: ${{ github.ref_name }}
  20. cancel-in-progress: true
  21. jobs:
  22. macOS:
  23. name: Test macOS, All Xcodes and Swifts
  24. runs-on: ${{ matrix.runsOn }}
  25. env:
  26. DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
  27. timeout-minutes: 10
  28. strategy:
  29. fail-fast: false
  30. matrix:
  31. include:
  32. - xcode: "Xcode_14.1.app"
  33. runsOn: macOS-12
  34. name: "macOS 12, Xcode 14.1, Swift 5.7.1"
  35. testPlan: "macOS"
  36. - xcode: "Xcode_14.0.1.app"
  37. runsOn: macOS-12
  38. name: "macOS 12, Xcode 14.0.1, Swift 5.7.0"
  39. testPlan: "macOS"
  40. - xcode: "Xcode_13.4.1.app"
  41. runsOn: macOS-12
  42. name: "macOS 12, Xcode 13.4.1, Swift 5.6.1"
  43. testPlan: "macOS-NoTS"
  44. - xcode: "Xcode_13.3.1.app"
  45. runsOn: macOS-12
  46. name: "macOS 12, Xcode 13.3.1, Swift 5.6.0"
  47. testPlan: "macOS-NoTS"
  48. - xcode: "Xcode_13.2.1.app"
  49. runsOn: macOS-11
  50. name: "macOS 11, Xcode 13.2.1, Swift 5.5.2"
  51. testPlan: "macOS-NoTS"
  52. - xcode: "Xcode_13.1.app"
  53. runsOn: macOS-11
  54. name: "macOS 11, Xcode 13.1, Swift 5.5.1"
  55. testPlan: "macOS-NoTS"
  56. - xcode: "Xcode_13.0.app"
  57. runsOn: macOS-11
  58. name: "macOS 11, Xcode 13.0, Swift 5.5.0"
  59. testPlan: "macOS-NoTS"
  60. - xcode: "Xcode_12.5.1.app"
  61. runsOn: macOS-11
  62. name: "macOS 11, Xcode 12.5.1, Swift 5.4.2"
  63. testPlan: "macOS-NoTS"
  64. - xcode: "Xcode_12.4.app"
  65. runsOn: macOS-10.15
  66. name: "macOS 10.15, Xcode 12.4, Swift 5.3.2"
  67. testPlan: "macOS-NoTS"
  68. - xcode: "Xcode_12.3.app"
  69. runsOn: macOS-10.15
  70. name: "macOS 10.15, Xcode 12.3, Swift 5.3.2"
  71. testPlan: "macOS-NoTS"
  72. - xcode: "Xcode_12.2.app"
  73. runsOn: macOS-10.15
  74. name: "macOS 10.15, Xcode 12.2, Swift 5.3.1"
  75. testPlan: "macOS-NoTS"
  76. - xcode: "Xcode_12.1.1.app"
  77. runsOn: macOS-10.15
  78. name: "macOS 10.15, Xcode 12.1.1, Swift 5.3.0"
  79. testPlan: "macOS-NoTS"
  80. steps:
  81. - uses: actions/checkout@v3
  82. - name: Install Firewalk
  83. run: "brew install alamofire/alamofire/firewalk && firewalk &"
  84. - name: ${{ matrix.name }}
  85. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  86. Catalyst:
  87. name: Test Catalyst
  88. runs-on: macOS-12
  89. env:
  90. DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
  91. timeout-minutes: 10
  92. steps:
  93. - uses: actions/checkout@v3
  94. - name: Install Firewalk
  95. run: brew install alamofire/alamofire/firewalk && firewalk &
  96. - name: Catalyst
  97. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test | xcpretty
  98. Latest:
  99. name: Test Latest (iOS, tvOS, watchOS)
  100. runs-on: macOS-12
  101. env:
  102. DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
  103. timeout-minutes: 10
  104. strategy:
  105. fail-fast: false
  106. matrix:
  107. include:
  108. - destination: "OS=16.1,name=iPhone 14 Pro"
  109. name: "iOS"
  110. scheme: "Alamofire iOS"
  111. - destination: "OS=16.1,name=Apple TV"
  112. name: "tvOS"
  113. scheme: "Alamofire tvOS"
  114. - destination: "OS=9.1,name=Apple Watch Series 8 (45mm)"
  115. name: "watchOS"
  116. scheme: "Alamofire watchOS"
  117. steps:
  118. - uses: actions/checkout@v3
  119. - name: Install Firewalk
  120. run: brew install alamofire/alamofire/firewalk && firewalk &
  121. - name: ${{ matrix.name }}
  122. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test | xcpretty
  123. iOS:
  124. name: "Test Old iOS"
  125. runs-on: firebreak
  126. env:
  127. DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
  128. timeout-minutes: 10
  129. strategy:
  130. fail-fast: false
  131. matrix:
  132. include:
  133. - destination: "OS=15.5,name=iPhone 13 Pro"
  134. name: "iOS 15.5"
  135. testPlan: "iOS-NoTS"
  136. - destination: "OS=14.5,name=iPhone 12 Pro"
  137. name: "iOS 14.5"
  138. testPlan: "iOS-NoTS"
  139. - destination: "OS=13.7,name=iPhone 11 Pro"
  140. name: "iOS 13.7"
  141. testPlan: "iOS-NoTS"
  142. - destination: "OS=12.4,name=iPhone Xs"
  143. name: "iOS 12.4"
  144. testPlan: "iOS-Old"
  145. steps:
  146. - uses: actions/checkout@v3
  147. - name: Install Firewalk
  148. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  149. - name: ${{ matrix.name }}
  150. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  151. tvOS:
  152. name: Test Old tvOS
  153. runs-on: firebreak
  154. env:
  155. DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
  156. timeout-minutes: 10
  157. strategy:
  158. fail-fast: false
  159. matrix:
  160. include:
  161. - destination: "OS=15.4,name=Apple TV"
  162. name: "tvOS 15.4"
  163. testPlan: "tvOS-NoTS"
  164. - destination: "OS=14.5,name=Apple TV"
  165. name: "tvOS 14.5"
  166. testPlan: "tvOS-NoTS"
  167. - destination: "OS=13.4,name=Apple TV"
  168. name: "tvOS 13.4"
  169. testPlan: "tvOS-NoTS"
  170. - destination: "OS=12.4,name=Apple TV"
  171. name: "tvOS 12.4"
  172. testPlan: "tvOS-Old"
  173. steps:
  174. - uses: actions/checkout@v3
  175. - name: Install Firewalk
  176. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  177. - name: ${{ matrix.name }}
  178. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  179. watchOS:
  180. name: Test Old watchOS
  181. runs-on: firebreak
  182. env:
  183. DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
  184. timeout-minutes: 10
  185. strategy:
  186. fail-fast: false
  187. matrix:
  188. include:
  189. - destination: "OS=8.5,name=Apple Watch Series 7 (45mm)"
  190. name: "watchOS 8.5"
  191. testPlan: "watchOS-NoTS"
  192. - destination: "OS=7.4,name=Apple Watch Series 6 (44mm)"
  193. name: "watchOS 7.4"
  194. testPlan: "watchOS-NoTS"
  195. steps:
  196. - uses: actions/checkout@v3
  197. - name: Install Firewalk
  198. run: brew install alamofire/alamofire/firewalk && firewalk &
  199. - name: ${{ matrix.name}}
  200. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  201. SPM:
  202. name: Test with SPM
  203. runs-on: ${{ matrix.runsOn }}
  204. env:
  205. DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
  206. timeout-minutes: 10
  207. strategy:
  208. fail-fast: false
  209. matrix:
  210. include:
  211. - xcode: "Xcode_14.1.app"
  212. runsOn: macOS-12
  213. name: "macOS 12, SPM 5.7.1 Test"
  214. run: "swift test -c debug"
  215. - xcode: "Xcode_14.0.1.app"
  216. runsOn: macOS-12
  217. name: "macOS 12, SPM 5.7.0 Test"
  218. run: "swift test -c debug"
  219. - xcode: "Xcode_13.4.1.app"
  220. runsOn: macOS-12
  221. name: "macOS 12, SPM 5.6.1 Test"
  222. run: "swift test -c debug"
  223. - xcode: "Xcode_13.3.1.app"
  224. runsOn: macOS-12
  225. name: "macOS 12, SPM 5.6.0 Test"
  226. run: "swift test -c debug"
  227. - xcode: "Xcode_13.2.1.app"
  228. runsOn: macOS-11
  229. name: "macOS 11, SPM 5.5.2 Test"
  230. run: "swift test -c debug"
  231. - xcode: "Xcode_13.1.app"
  232. runsOn: macOS-11
  233. name: "macOS 11, SPM 5.5.1 Test"
  234. run: "swift test -c debug"
  235. - xcode: "Xcode_13.0.app"
  236. runsOn: macOS-11
  237. name: "macOS 11, SPM 5.5.0 Test"
  238. run: "swift test -c debug"
  239. - xcode: "Xcode_12.5.1.app"
  240. runsOn: macOS-11
  241. name: "macOS 11, SPM 5.4.2 Build"
  242. run: "swift build -c debug"
  243. - xcode: "Xcode_12.4.app"
  244. runsOn: macOS-10.15
  245. name: "macOS 10.15, SPM 5.3.2 Build"
  246. run: "swift build -c debug"
  247. - xcode: "Xcode_12.3.app"
  248. runsOn: macOS-10.15
  249. name: "macOS 10.15, SPM 5.3.2 Build"
  250. run: "swift build -c debug"
  251. - xcode: "Xcode_12.2.app"
  252. runsOn: macOS-10.15
  253. name: "macOS 10.15, SPM 5.3.1 Build"
  254. run: "swift build -c debug"
  255. - xcode: "Xcode_12.1.app"
  256. runsOn: macOS-10.15
  257. name: "macOS 10.15, SPM 5.3.0 Build"
  258. run: "swift build -c debug"
  259. steps:
  260. - uses: actions/checkout@v3
  261. - name: Install Firewalk
  262. run: brew install alamofire/alamofire/firewalk && firewalk &
  263. - name: Test SPM
  264. run: ${{ matrix.run }}
  265. Linux:
  266. name: Linux
  267. runs-on: ubuntu-latest
  268. strategy:
  269. fail-fast: false
  270. matrix:
  271. include:
  272. - image: swift:5.7-bionic
  273. - image: swift:5.7-focal
  274. - image: swift:5.7-centos7
  275. - image: swift:5.7-amazonlinux2
  276. - image: swiftlang/swift:nightly-bionic
  277. - image: swiftlang/swift:nightly-focal
  278. - image: swiftlang/swift:nightly-jammy
  279. # - image: swiftlang/swift:nightly-centos7
  280. - image: swiftlang/swift:nightly-centos8
  281. - image: swiftlang/swift:nightly-amazonlinux2
  282. container:
  283. image: ${{ matrix.image }}
  284. timeout-minutes: 10
  285. steps:
  286. - uses: actions/checkout@v3
  287. - name: ${{ matrix.image }}
  288. run: swift build --build-tests -c debug
  289. Windows:
  290. name: Windows
  291. runs-on: windows-2019
  292. timeout-minutes: 10
  293. steps:
  294. - name: "Clone Project"
  295. uses: actions/checkout@v3
  296. - uses: seanmiddleditch/gha-setup-vsdevenv@master
  297. - name: Install Swift
  298. run: |
  299. Install-Binary -Url "https://download.swift.org/swift-5.6-release/windows10/swift-5.6-RELEASE/swift-5.6-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
  300. - name: Set Environment Variables
  301. run: |
  302. echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  303. echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  304. - name: Adjust Paths
  305. run: |
  306. echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  307. echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  308. - name: Install Supporting Files
  309. run: |
  310. Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
  311. Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
  312. Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
  313. Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
  314. - name: SPM Windows build
  315. shell: cmd
  316. run: |
  317. cd ${{ github.workspace}}
  318. set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
  319. %SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
  320. if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1