ci.yml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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:
  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. iOS:
  60. name: "Test iOS"
  61. runs-on: firebreak
  62. defaults:
  63. run:
  64. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  65. env:
  66. DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer"
  67. timeout-minutes: 10
  68. strategy:
  69. fail-fast: false
  70. matrix:
  71. include:
  72. - destination: "OS=15.2,name=iPhone 13 Pro"
  73. name: "iOS 15.2"
  74. - destination: "OS=14.5,name=iPhone 12 Pro"
  75. name: "iOS 14.5"
  76. - destination: "OS=13.7,name=iPhone 11 Pro"
  77. name: "iOS 13.7"
  78. # - destination: "OS=12.4,name=iPhone Xs"
  79. # name: "iOS 12.4"
  80. # - destination: "OS=11.4,name=iPhone 7"
  81. # name: "iOS 11.4"
  82. steps:
  83. - uses: actions/checkout@v2
  84. - name: Install Firewalk
  85. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  86. - name: ${{ matrix.name }}
  87. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  88. tvOS:
  89. name: Test tvOS
  90. runs-on: firebreak
  91. defaults:
  92. run:
  93. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  94. env:
  95. DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
  96. timeout-minutes: 10
  97. strategy:
  98. fail-fast: false
  99. matrix:
  100. include:
  101. - destination: "OS=15.2,name=Apple TV"
  102. name: "tvOS 15.2"
  103. - destination: "OS=14.5,name=Apple TV"
  104. name: "tvOS 14.5"
  105. - destination: "OS=13.4,name=Apple TV"
  106. name: "tvOS 13.4"
  107. steps:
  108. - uses: actions/checkout@v2
  109. - name: Install Firewalk
  110. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  111. - name: ${{ matrix.name }}
  112. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  113. watchOS:
  114. name: Test watchOS
  115. runs-on: firebreak
  116. defaults:
  117. run:
  118. shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}"
  119. env:
  120. DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
  121. timeout-minutes: 10
  122. strategy:
  123. fail-fast: false
  124. matrix:
  125. include:
  126. - destination: "OS=8.3,name=Apple Watch Series 7 - 45mm"
  127. name: "watchOS 8.3"
  128. - destination: "OS=7.4,name=Apple Watch Series 6 - 44mm"
  129. name: "watchOS 7.4"
  130. steps:
  131. - uses: actions/checkout@v2
  132. - name: Install Firewalk
  133. run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
  134. - name: ${{ matrix.name}}
  135. run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" clean test | xcpretty
  136. SPM:
  137. name: Test with SPM
  138. runs-on: macOS-11
  139. env:
  140. DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
  141. timeout-minutes: 10
  142. steps:
  143. - uses: actions/checkout@v2
  144. - name: Install Firewalk
  145. run: brew install alamofire/alamofire/firewalk && firewalk &
  146. - name: Test SPM
  147. run: swift test -c debug
  148. Linux:
  149. name: Linux
  150. runs-on: ubuntu-20.04
  151. container:
  152. image: swift:5.5.2-focal
  153. timeout-minutes: 10
  154. steps:
  155. - uses: actions/checkout@v2
  156. - name: SPM Linux build
  157. run: swift build --build-tests -c debug
  158. Linux_Nightly:
  159. name: Linux Nightly
  160. runs-on: ubuntu-20.04
  161. container:
  162. image: swiftlang/swift:nightly-focal
  163. timeout-minutes: 10
  164. steps:
  165. - uses: actions/checkout@v2
  166. - name: SPM Linux build
  167. run: swift build --build-tests -c debug
  168. Windows:
  169. name: Windows
  170. runs-on: windows-2019
  171. timeout-minutes: 10
  172. steps:
  173. - name: "Clone Project"
  174. uses: actions/checkout@v2
  175. - uses: seanmiddleditch/gha-setup-vsdevenv@master
  176. - name: Install Swift
  177. run: |
  178. 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")
  179. - name: Set Environment Variables
  180. run: |
  181. echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  182. echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
  183. - name: Adjust Paths
  184. run: |
  185. echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  186. echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  187. - name: Install Supporting Files
  188. run: |
  189. Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
  190. Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
  191. Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
  192. Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
  193. - name: SPM Windows build
  194. shell: cmd
  195. run: |
  196. cd ${{ github.workspace}}
  197. set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
  198. %SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
  199. if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1