ci.yml 11 KB

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