ci.yml 12 KB

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