ci.yml 7.7 KB

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