ci.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. name: "Alamofire CI"
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - hotfix
  7. paths:
  8. - ".github/workflows/**"
  9. - "Package.swift"
  10. - "Source/**"
  11. - "Tests/**"
  12. pull_request:
  13. paths:
  14. - ".github/workflows/**"
  15. - "Package.swift"
  16. - "Source/**"
  17. - "Tests/**"
  18. concurrency:
  19. group: ${{ github.ref_name }}
  20. cancel-in-progress: true
  21. jobs:
  22. macOS:
  23. name: ${{ matrix.name }}
  24. runs-on: ${{ matrix.runsOn }}
  25. env:
  26. DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
  27. timeout-minutes: 10
  28. strategy:
  29. fail-fast: false
  30. matrix:
  31. include:
  32. - xcode: "Xcode_15.2"
  33. runsOn: firebreak
  34. name: "macOS 13, Xcode 15.2, Swift 5.9.2"
  35. testPlan: "macOS"
  36. outputFilter: xcbeautify --renderer github-actions
  37. - xcode: "Xcode_15.1"
  38. runsOn: macOS-14
  39. name: "macOS 14, Xcode 15.1, Swift 5.9.1"
  40. testPlan: "macOS"
  41. outputFilter: xcbeautify --renderer github-actions
  42. - xcode: "Xcode_15.0.1"
  43. runsOn: macOS-14
  44. name: "macOS 14, Xcode 15.0.1, Swift 5.9.0"
  45. testPlan: "macOS"
  46. outputFilter: xcbeautify --renderer github-actions
  47. - xcode: "Xcode_14.3.1"
  48. runsOn: macOS-13
  49. name: "macOS 13, Xcode 14.3.1, Swift 5.8.0"
  50. testPlan: "macOS"
  51. outputFilter: xcbeautify --renderer github-actions
  52. - xcode: "Xcode_14.2"
  53. runsOn: macOS-12
  54. name: "macOS 12, Xcode 14.2, Swift 5.7.2"
  55. testPlan: "macOS"
  56. outputFilter: xcpretty
  57. - xcode: "Xcode_14.1"
  58. runsOn: macOS-12
  59. name: "macOS 12, Xcode 14.1, Swift 5.7.1"
  60. testPlan: "macOS"
  61. outputFilter: xcpretty
  62. steps:
  63. - uses: actions/checkout@v4
  64. - name: ${{ matrix.name }}
  65. run: |-
  66. set -o pipefail
  67. brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk
  68. firewalk &
  69. env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" -testPlan "${{ matrix.testPlan }}" clean test | ${{ matrix.outputFilter }}
  70. Catalyst:
  71. name: ${{ matrix.name }}
  72. runs-on: ${{ matrix.runsOn }}
  73. env:
  74. DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
  75. timeout-minutes: 10
  76. strategy:
  77. fail-fast: false
  78. matrix:
  79. include:
  80. - xcode: "Xcode_15.2"
  81. name: "Catalyst 15.2"
  82. runsOn: firebreak
  83. - xcode: "Xcode_15.1"
  84. name: "Catalyst 15.1"
  85. runsOn: macOS-14
  86. - xcode: "Xcode_15.0.1"
  87. name: "Catalyst 15.0"
  88. runsOn: macOS-14
  89. - xcode: "Xcode_14.3.1"
  90. name: "Catalyst 14.3.1"
  91. runsOn: macOS-13
  92. steps:
  93. - uses: actions/checkout@v4
  94. - name: Install Firewalk
  95. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  96. - name: Catalyst
  97. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test 2>&1 | xcbeautify --renderer github-actions
  98. iOS:
  99. name: ${{ matrix.name }}
  100. runs-on: ${{ matrix.runsOn }}
  101. env:
  102. DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
  103. timeout-minutes: 10
  104. strategy:
  105. fail-fast: false
  106. matrix:
  107. include:
  108. - destination: "OS=17.2,name=iPhone 15 Pro"
  109. name: "iOS 17.2"
  110. testPlan: "iOS"
  111. xcode: "Xcode_15.2"
  112. runsOn: firebreak
  113. - destination: "OS=17.0,name=iPhone 15 Pro"
  114. name: "iOS 17.0"
  115. testPlan: "iOS"
  116. xcode: "Xcode_15.0.1"
  117. runsOn: macOS-14
  118. - destination: "OS=16.4,name=iPhone 14 Pro"
  119. name: "iOS 16.4"
  120. testPlan: "iOS"
  121. xcode: "Xcode_14.3.1"
  122. runsOn: macOS-13
  123. - destination: "OS=15.5,name=iPhone 13 Pro"
  124. name: "iOS 15.5"
  125. testPlan: "iOS-NoTS"
  126. xcode: "Xcode_14.3.1"
  127. runsOn: firebreak
  128. steps:
  129. - uses: actions/checkout@v4
  130. - name: Install Firewalk
  131. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  132. - name: ${{ matrix.name }}
  133. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcbeautify --renderer github-actions
  134. tvOS:
  135. name: ${{ matrix.name }}
  136. runs-on: ${{ matrix.runsOn }}
  137. env:
  138. DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
  139. timeout-minutes: 10
  140. strategy:
  141. fail-fast: false
  142. matrix:
  143. include:
  144. - destination: "OS=17.2,name=Apple TV"
  145. name: "tvOS 17.2"
  146. testPlan: "tvOS"
  147. xcode: "Xcode_15.2"
  148. runsOn: firebreak
  149. - destination: "OS=17.0,name=Apple TV"
  150. name: "tvOS 17.0"
  151. testPlan: "tvOS"
  152. xcode: "Xcode_15.0.1"
  153. runsOn: macOS-14
  154. - destination: "OS=16.4,name=Apple TV"
  155. name: "tvOS 16.4"
  156. testPlan: "tvOS"
  157. xcode: "Xcode_14.3.1"
  158. runsOn: macOS-13
  159. - destination: "OS=15.4,name=Apple TV"
  160. name: "tvOS 15.4"
  161. testPlan: "tvOS-NoTS"
  162. xcode: "Xcode_14.3.1"
  163. runsOn: firebreak
  164. steps:
  165. - uses: actions/checkout@v4
  166. - name: Install Firewalk
  167. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  168. - name: ${{ matrix.name }}
  169. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcbeautify --renderer github-actions
  170. visionOS:
  171. name: ${{ matrix.name }}
  172. runs-on: ${{ matrix.runsOn }}
  173. env:
  174. DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
  175. timeout-minutes: 10
  176. strategy:
  177. fail-fast: false
  178. matrix:
  179. include:
  180. - destination: "OS=1.0,name=Apple Vision Pro"
  181. name: "visionOS 1.0"
  182. testPlan: "visionOS"
  183. scheme: "Alamofire visionOS"
  184. runsOn: firebreak
  185. steps:
  186. - uses: actions/checkout@v4
  187. - name: Install Firewalk
  188. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  189. - name: ${{ matrix.name }}
  190. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcbeautify --renderer github-actions
  191. watchOS:
  192. name: ${{ matrix.name }}
  193. runs-on: ${{ matrix.runsOn }}
  194. env:
  195. DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
  196. timeout-minutes: 10
  197. strategy:
  198. fail-fast: false
  199. matrix:
  200. include:
  201. - destination: "OS=10.2,name=Apple Watch Series 9 (45mm)"
  202. name: "watchOS 10.2"
  203. testPlan: "watchOS"
  204. xcode: "Xcode_15.2"
  205. runsOn: firebreak
  206. - destination: "OS=10.0,name=Apple Watch Series 9 (45mm)"
  207. name: "watchOS 10.0"
  208. testPlan: "watchOS"
  209. xcode: "Xcode_15.0.1"
  210. runsOn: macOS-14
  211. - destination: "OS=9.4,name=Apple Watch Series 8 (45mm)"
  212. name: "watchOS 9.4"
  213. testPlan: "watchOS"
  214. xcode: "Xcode_14.3.1"
  215. runsOn: macOS-13
  216. - destination: "OS=8.5,name=Apple Watch Series 7 (45mm)"
  217. name: "watchOS 8.5"
  218. testPlan: "watchOS-NoTS"
  219. xcode: "Xcode_14.3.1"
  220. runsOn: firebreak
  221. steps:
  222. - uses: actions/checkout@v4
  223. - name: Install Firewalk
  224. run: brew update && brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  225. - name: ${{ matrix.name }}
  226. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcbeautify --renderer github-actions
  227. SPM:
  228. name: ${{ matrix.name }}
  229. runs-on: ${{ matrix.runsOn }}
  230. env:
  231. DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
  232. timeout-minutes: 10
  233. strategy:
  234. fail-fast: false
  235. matrix:
  236. include:
  237. - xcode: "Xcode_15.2"
  238. runsOn: firebreak
  239. name: "macOS 13, SPM 5.9.2 Test"
  240. outputFilter: xcbeautify --renderer github-actions
  241. - xcode: "Xcode_15.1"
  242. runsOn: macOS-14
  243. name: "macOS 14, SPM 5.9.1 Test"
  244. outputFilter: xcbeautify --renderer github-actions
  245. - xcode: "Xcode_15.0.1"
  246. runsOn: macOS-14
  247. name: "macOS 14, SPM 5.9.0 Test"
  248. outputFilter: xcbeautify --renderer github-actions
  249. - xcode: "Xcode_14.3.1"
  250. runsOn: macOS-13
  251. name: "macOS 13, SPM 5.8.0 Test"
  252. outputFilter: xcbeautify --renderer github-actions
  253. - xcode: "Xcode_14.2"
  254. runsOn: macOS-12
  255. name: "macOS 12, SPM 5.7.2 Test"
  256. outputFilter: xcpretty
  257. - xcode: "Xcode_14.1"
  258. runsOn: macOS-12
  259. name: "macOS 12, SPM 5.7.1 Test"
  260. outputFilter: xcpretty
  261. steps:
  262. - uses: actions/checkout@v4
  263. - name: Install Firewalk
  264. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk xcbeautify && firewalk &
  265. - name: Test SPM
  266. run: swift test -c debug | ${{ matrix.outputFilter }}
  267. Linux:
  268. name: Linux
  269. runs-on: ubuntu-latest
  270. strategy:
  271. fail-fast: false
  272. matrix:
  273. include:
  274. - image: swift:5.8-focal
  275. - image: swift:5.8-jammy
  276. - image: swift:5.8-centos7
  277. - image: swift:5.8-amazonlinux2
  278. - image: swift:5.8-rhel-ubi9
  279. - image: swift:5.9-focal
  280. - image: swift:5.9-jammy
  281. - image: swift:5.9-centos7
  282. - image: swift:5.9-amazonlinux2
  283. - image: swift:5.9-rhel-ubi9
  284. - image: swiftlang/swift:nightly-focal
  285. - image: swiftlang/swift:nightly-jammy
  286. - image: swiftlang/swift:nightly-amazonlinux2
  287. container:
  288. image: ${{ matrix.image }}
  289. timeout-minutes: 10
  290. steps:
  291. - uses: actions/checkout@v3
  292. - name: ${{ matrix.image }}
  293. run: swift build --build-tests -c debug
  294. Android:
  295. name: Android
  296. uses: hggz/swift-android-sdk/.github/workflows/sdks.yml@ci
  297. strategy:
  298. fail-fast: false
  299. with:
  300. target-repo: ${{ github.repository }}
  301. checkout-hash: ${{ github.sha }}
  302. Windows:
  303. name: ${{ matrix.name }}
  304. runs-on: windows-latest
  305. timeout-minutes: 10
  306. strategy:
  307. fail-fast: false
  308. matrix:
  309. include:
  310. - branch: swift-5.8-release
  311. tag: 5.8-RELEASE
  312. name: Windows Swift 5.8
  313. - branch: swift-5.9-release
  314. tag: 5.9-RELEASE
  315. name: Windows Swift 5.9
  316. steps:
  317. - name: Setup
  318. uses: compnerd/gha-setup-swift@main
  319. with:
  320. branch: ${{ matrix.branch }}
  321. tag: ${{ matrix.tag }}
  322. - name: Clone
  323. uses: actions/checkout@v4
  324. - name: SPM ${{ matrix.name }}
  325. run: |
  326. swift build --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
  327. CodeQL:
  328. name: Analyze with CodeQL
  329. runs-on: macOS-13
  330. env:
  331. DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer"
  332. timeout-minutes: 10
  333. steps:
  334. - name: Clone
  335. uses: actions/checkout@v4
  336. - name: Initialize CodeQL
  337. uses: github/codeql-action/init@v2
  338. with:
  339. languages: swift
  340. - name: Build macOS
  341. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean build | xcpretty
  342. - name: Perform CodeQL Analysis
  343. uses: github/codeql-action/analyze@v2
  344. with:
  345. category: "/language:swift"