ci.yml 8.8 KB

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