ci.yml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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: ci
  20. cancel-in-progress: true
  21. jobs:
  22. macOS_5_3:
  23. name: Test macOS 10.15 (5.3)
  24. runs-on: macOS-10.15
  25. env:
  26. DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
  27. timeout-minutes: 10
  28. steps:
  29. - uses: actions/checkout@v2
  30. - name: Install Firewalk
  31. run: brew install alamofire/alamofire/firewalk && firewalk &
  32. - name: macOS 10.15 (5.3)
  33. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean test | xcpretty
  34. macOS_5_4:
  35. name: Test macOS 11 (5.4)
  36. runs-on: macOS-11
  37. env:
  38. DEVELOPER_DIR: /Applications/Xcode_12.5.1.app/Contents/Developer
  39. timeout-minutes: 10
  40. steps:
  41. - uses: actions/checkout@v2
  42. - name: Install Firewalk
  43. run: brew install alamofire/alamofire/firewalk && firewalk &
  44. - name: macOS 11 (5.4)
  45. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean test | xcpretty
  46. macOS_5_5:
  47. name: Test macOS 11 (5.5)
  48. runs-on: firebreak
  49. defaults:
  50. run:
  51. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  52. env:
  53. DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
  54. timeout-minutes: 10
  55. steps:
  56. - uses: actions/checkout@v2
  57. - name: Install Firewalk
  58. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  59. - name: macOS 11 (5.5)
  60. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean test | xcpretty
  61. Catalyst:
  62. name: Test Catalyst
  63. runs-on: macOS-11
  64. env:
  65. DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
  66. timeout-minutes: 10
  67. steps:
  68. - uses: actions/checkout@v2
  69. - name: Install Firewalk
  70. run: brew install alamofire/alamofire/firewalk && firewalk &
  71. - name: Catalyst
  72. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test | xcpretty
  73. iOS:
  74. name: Test iOS 15
  75. runs-on: firebreak
  76. defaults:
  77. run:
  78. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  79. env:
  80. DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
  81. timeout-minutes: 10
  82. strategy:
  83. matrix:
  84. destination: ["OS=15.0,name=iPhone 13 Pro"]
  85. steps:
  86. - uses: actions/checkout@v2
  87. - name: Install Firewalk
  88. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  89. - name: iOS - ${{ matrix.destination }}
  90. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  91. iOS_Concurrency:
  92. name: Test Swift Concurrency
  93. runs-on: macOS-11
  94. env:
  95. DEVELOPER_DIR: /Applications/Xcode_13.2.app/Contents/Developer
  96. timeout-minutes: 10
  97. strategy:
  98. matrix:
  99. destination: ["OS=15.2,name=iPhone 13 Pro"]
  100. steps:
  101. - uses: actions/checkout@v2
  102. - name: Install Firewalk
  103. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  104. - name: iOS - ${{ matrix.destination }}
  105. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -enableThreadSanitizer NO clean test | xcpretty
  106. tvOS:
  107. name: Test tvOS
  108. runs-on: firebreak
  109. defaults:
  110. run:
  111. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  112. env:
  113. DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
  114. timeout-minutes: 10
  115. strategy:
  116. matrix:
  117. destination: ["OS=15.0,name=Apple TV"]
  118. steps:
  119. - uses: actions/checkout@v2
  120. - name: Install Firewalk
  121. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  122. - name: tvOS - ${{ matrix.destination }}
  123. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  124. watchOS:
  125. name: Test watchOS
  126. runs-on: firebreak
  127. defaults:
  128. run:
  129. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  130. env:
  131. DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
  132. timeout-minutes: 10
  133. strategy:
  134. matrix:
  135. destination: ["OS=8.0,name=Apple Watch Series 7 - 45mm"]
  136. steps:
  137. - uses: actions/checkout@v2
  138. - name: Install Firewalk
  139. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  140. - name: watchOS - ${{ matrix.destination }}
  141. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  142. SPM:
  143. name: Test with SPM
  144. runs-on: firebreak
  145. defaults:
  146. run:
  147. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  148. env:
  149. DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
  150. timeout-minutes: 10
  151. steps:
  152. - uses: actions/checkout@v2
  153. - name: Install Firewalk
  154. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  155. - name: SPM Test
  156. run: swift test -c debug
  157. Linux:
  158. name: Linux
  159. runs-on: ubuntu-20.04
  160. container:
  161. image: swift:5.5.1-focal
  162. timeout-minutes: 10
  163. steps:
  164. - uses: actions/checkout@v2
  165. - name: SPM Linux build
  166. run: swift build --build-tests -c debug
  167. Linux_Nightly:
  168. name: Linux Nightly
  169. runs-on: ubuntu-20.04
  170. container:
  171. image: swiftlang/swift:nightly-focal
  172. timeout-minutes: 10
  173. steps:
  174. - uses: actions/checkout@v2
  175. - name: SPM Linux build
  176. run: swift build --build-tests -c debug
  177. Windows:
  178. name: Windows
  179. runs-on: windows-2019
  180. timeout-minutes: 10
  181. steps:
  182. - name: "Clone Project"
  183. uses: actions/checkout@v2
  184. - uses: seanmiddleditch/gha-setup-vsdevenv@master
  185. - name: Install Swift
  186. run: |
  187. Install-Binary -Url "https://swift.org/builds/swift-5.5.1-release/windows10/swift-5.5.1-RELEASE/swift-5.5.1-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
  188. - name: Set Environment Variables
  189. run: |
  190. echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  191. echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  192. - name: Adjust Paths
  193. run: |
  194. echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  195. echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  196. - name: Install Supporting Files
  197. run: |
  198. Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
  199. Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
  200. Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
  201. Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
  202. - name: SPM Windows build
  203. shell: cmd
  204. run: |
  205. cd ${{ github.workspace}}
  206. set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
  207. %SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
  208. if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1