ci.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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 2>&1 | ${{ 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: swift:5.10-focal
  285. - image: swift:5.10-jammy
  286. - image: swift:5.10-centos7
  287. - image: swift:5.10-amazonlinux2
  288. - image: swift:5.10-rhel-ubi9
  289. - image: swiftlang/swift:nightly-focal
  290. - image: swiftlang/swift:nightly-jammy
  291. - image: swiftlang/swift:nightly-amazonlinux2
  292. container:
  293. image: ${{ matrix.image }}
  294. timeout-minutes: 10
  295. steps:
  296. - uses: actions/checkout@v3
  297. - name: ${{ matrix.image }}
  298. run: swift build --build-tests -c debug
  299. Android:
  300. name: Android
  301. uses: hggz/swift-android-sdk/.github/workflows/sdks.yml@ci
  302. strategy:
  303. fail-fast: false
  304. with:
  305. target-repo: ${{ github.repository }}
  306. checkout-hash: ${{ github.sha }}
  307. Windows:
  308. name: ${{ matrix.name }}
  309. runs-on: windows-latest
  310. timeout-minutes: 10
  311. strategy:
  312. fail-fast: false
  313. matrix:
  314. include:
  315. - branch: swift-5.8-release
  316. tag: 5.8-RELEASE
  317. name: Windows Swift 5.8
  318. - branch: swift-5.9-release
  319. tag: 5.9-RELEASE
  320. name: Windows Swift 5.9
  321. - branch: swift-5.10-release
  322. tag: 5.10-RELEASE
  323. name: Windows Swift 5.10
  324. steps:
  325. - name: Setup
  326. uses: compnerd/gha-setup-swift@main
  327. with:
  328. branch: ${{ matrix.branch }}
  329. tag: ${{ matrix.tag }}
  330. - name: Clone
  331. uses: actions/checkout@v4
  332. - name: SPM ${{ matrix.name }}
  333. run: |
  334. swift build --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
  335. CodeQL:
  336. name: Analyze with CodeQL
  337. runs-on: macOS-13
  338. env:
  339. DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer"
  340. timeout-minutes: 10
  341. steps:
  342. - name: Clone
  343. uses: actions/checkout@v4
  344. - name: Initialize CodeQL
  345. uses: github/codeql-action/init@v2
  346. with:
  347. languages: swift
  348. - name: Build macOS
  349. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean build | xcpretty
  350. - name: Perform CodeQL Analysis
  351. uses: github/codeql-action/analyze@v2
  352. with:
  353. category: "/language:swift"