ci.yml 12 KB

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