ci.yml 11 KB

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