ci.yml 11 KB

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