ci.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. - destination: "OS=11.4,name=iPhone 7"
  107. name: "iOS 11.4"
  108. testPlan: "iOS-Old"
  109. steps:
  110. - uses: actions/checkout@v2
  111. - name: Install Firewalk
  112. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  113. - name: ${{ matrix.name }}
  114. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  115. tvOS:
  116. name: Test tvOS
  117. runs-on: firebreak
  118. defaults:
  119. run:
  120. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  121. env:
  122. DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
  123. timeout-minutes: 10
  124. strategy:
  125. fail-fast: false
  126. matrix:
  127. include:
  128. - destination: "OS=14.5,name=Apple TV"
  129. name: "tvOS 14.5"
  130. testPlan: "tvOS"
  131. - destination: "OS=13.4,name=Apple TV"
  132. name: "tvOS 13.4"
  133. testPlan: "tvOS"
  134. - destination: "OS=12.4,name=Apple TV"
  135. name: "tvOS 12.4"
  136. testPlan: "tvOS-Old"
  137. - destination: "OS=11.4,name=Apple TV"
  138. name: "tvOS 11.4"
  139. testPlan: "tvOS-Old"
  140. steps:
  141. - uses: actions/checkout@v2
  142. - name: Install Firewalk
  143. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  144. - name: ${{ matrix.name }}
  145. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  146. watchOS:
  147. name: Test watchOS
  148. runs-on: firebreak
  149. defaults:
  150. run:
  151. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  152. env:
  153. DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
  154. timeout-minutes: 10
  155. strategy:
  156. fail-fast: false
  157. matrix:
  158. include:
  159. - destination: "OS=7.4,name=Apple Watch Series 6 - 44mm"
  160. name: "watchOS 7.4"
  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 watchOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  167. Thread_Sanitizer:
  168. name: Test Thread Sanitizer
  169. runs-on: macOS-11
  170. env:
  171. DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer"
  172. timeout-minutes: 10
  173. strategy:
  174. fail-fast: false
  175. matrix:
  176. include:
  177. - scheme: "Alamofire macOS"
  178. destination: "platform=macOS"
  179. testPlan: "macOS-TS"
  180. name: "macOS Thread Sanitizer"
  181. - scheme: "Alamofire iOS"
  182. destination: "OS=15.2,name=iPhone 13 Pro"
  183. testPlan: "iOS-TS"
  184. name: "iOS Thread Sanitizer"
  185. - scheme: "Alamofire tvOS"
  186. destination: "OS=15.2,name=Apple TV"
  187. testPlan: "tvOS-TS"
  188. name: "tvOS Thread Sanitizer"
  189. - scheme: "Alamofire watchOS"
  190. destination: "OS=8.3,name=Apple Watch Series 7 - 45mm"
  191. testPlan: "watchOS-TS"
  192. name: "watchOS Thread Sanitizer"
  193. steps:
  194. - uses: actions/checkout@v2
  195. - name: Install Firewalk
  196. run: brew install alamofire/alamofire/firewalk && firewalk &
  197. - name: ${{ matrix.name }}
  198. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
  199. SPM:
  200. name: Test with SPM
  201. runs-on: macOS-11
  202. env:
  203. DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
  204. timeout-minutes: 10
  205. steps:
  206. - uses: actions/checkout@v2
  207. - name: Install Firewalk
  208. run: brew install alamofire/alamofire/firewalk && firewalk &
  209. - name: Test SPM
  210. run: swift test -c debug
  211. Linux:
  212. name: Linux
  213. runs-on: ubuntu-20.04
  214. container:
  215. image: swift:5.5.2-focal
  216. timeout-minutes: 10
  217. steps:
  218. - uses: actions/checkout@v2
  219. - name: SPM Linux build
  220. run: swift build --build-tests -c debug
  221. Linux_Nightly:
  222. name: Linux Nightly
  223. runs-on: ubuntu-20.04
  224. container:
  225. image: swiftlang/swift:nightly-focal
  226. timeout-minutes: 10
  227. steps:
  228. - uses: actions/checkout@v2
  229. - name: SPM Linux build
  230. run: swift build --build-tests -c debug
  231. Windows:
  232. name: Windows
  233. runs-on: windows-2019
  234. timeout-minutes: 10
  235. steps:
  236. - name: "Clone Project"
  237. uses: actions/checkout@v2
  238. - uses: seanmiddleditch/gha-setup-vsdevenv@master
  239. - name: Install Swift
  240. run: |
  241. 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")
  242. - name: Set Environment Variables
  243. run: |
  244. echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  245. echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  246. - name: Adjust Paths
  247. run: |
  248. echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  249. echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  250. - name: Install Supporting Files
  251. run: |
  252. Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
  253. Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
  254. Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
  255. Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
  256. - name: SPM Windows build
  257. shell: cmd
  258. run: |
  259. cd ${{ github.workspace}}
  260. set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
  261. %SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
  262. if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1