name: "Alamofire CI" on: push: branches: - master - hotfix paths: - 'Source/**' - 'Tests/**' - '.github/workflows/**' - 'Package.swift' pull_request: paths: - 'Source/**' - 'Tests/**' - '.github/workflows/**' - 'Package.swift' concurrency: group: ${{ github.ref_name }} cancel-in-progress: true jobs: macOS: name: Test macOS (5.5, 5.4, 5.3) runs-on: ${{ matrix.runsOn }} env: DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer" timeout-minutes: 10 strategy: fail-fast: false matrix: include: - xcode: "Xcode_13.2.1.app" runsOn: macOS-11 name: "macOS 11, Swift 5.5" - xcode: "Xcode_12.5.1.app" runsOn: macOS-11 name: "macOS 11, Swift 5.4" - xcode: "Xcode_12.4.app" runsOn: macOS-10.15 name: "macOS 10.15, Swift 5.3" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk && firewalk & - name: ${{ matrix.name }} run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean test | xcpretty Catalyst: name: Test Catalyst runs-on: macOS-11 env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk && firewalk & - name: Catalyst run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test | xcpretty Latest: name: Test Latest (iOS, tvOS, watchOS) runs-on: macOS-11 env: DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer" timeout-minutes: 10 strategy: fail-fast: false matrix: include: - destination: "OS=15.2,name=iPhone 13 Pro" name: "iOS 15.2" scheme: "Alamofire iOS" - destination: "OS=15.2,name=Apple TV" name: "tvOS 15.2" scheme: "Alamofire tvOS" - destination: "OS=8.3,name=Apple Watch Series 7 - 45mm" name: "watchOS 8.3" scheme: "Alamofire watchOS" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk && firewalk & - name: ${{ matrix.name }} run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test | xcpretty iOS: name: "Test iOS" runs-on: firebreak defaults: run: shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}" env: DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer" timeout-minutes: 10 strategy: fail-fast: false matrix: include: - destination: "OS=14.5,name=iPhone 12 Pro" name: "iOS 14.5" testPlan: "iOS" - destination: "OS=13.7,name=iPhone 11 Pro" name: "iOS 13.7" testPlan: "iOS" - destination: "OS=12.4,name=iPhone Xs" name: "iOS 12.4" testPlan: "iOS-Old" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & - name: ${{ matrix.name }} run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty tvOS: name: Test tvOS runs-on: firebreak defaults: run: shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}" env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer timeout-minutes: 10 strategy: fail-fast: false matrix: include: - destination: "OS=14.5,name=Apple TV" name: "tvOS 14.5" testPlan: "tvOS" - destination: "OS=13.4,name=Apple TV" name: "tvOS 13.4" testPlan: "tvOS" - destination: "OS=12.4,name=Apple TV" name: "tvOS 12.4" testPlan: "tvOS-Old" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & - name: ${{ matrix.name }} run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty watchOS: name: Test watchOS runs-on: firebreak defaults: run: shell: "/usr/bin/arch -arch arm64e /bin/zsh {0}" env: DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer timeout-minutes: 10 strategy: fail-fast: false matrix: include: - destination: "OS=7.4,name=Apple Watch Series 6 - 44mm" name: "watchOS 7.4" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk & - name: ${{ matrix.name}} run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" clean test | xcpretty Thread_Sanitizer: name: Test Thread Sanitizer runs-on: macOS-11 env: DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer" timeout-minutes: 10 strategy: fail-fast: false matrix: include: - scheme: "Alamofire macOS" destination: "platform=macOS" testPlan: "macOS-TS" name: "macOS Thread Sanitizer" - scheme: "Alamofire iOS" destination: "OS=15.2,name=iPhone 13 Pro" testPlan: "iOS-TS" name: "iOS Thread Sanitizer" - scheme: "Alamofire tvOS" destination: "OS=15.2,name=Apple TV" testPlan: "tvOS-TS" name: "tvOS Thread Sanitizer" - scheme: "Alamofire watchOS" destination: "OS=8.3,name=Apple Watch Series 7 - 45mm" testPlan: "watchOS-TS" name: "watchOS Thread Sanitizer" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk && firewalk & - name: ${{ matrix.name }} run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty SPM: name: Test with SPM runs-on: macOS-11 env: DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer" timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk && firewalk & - name: Test SPM run: swift test -c debug SPM_Older: name: Test with SPM runs-on: ${{ matrix.runsOn }} env: DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer" timeout-minutes: 10 strategy: fail-fast: false matrix: include: - xcode: "Xcode_12.5.1.app" runsOn: macOS-11 name: "macOS 11, SPM 5.4 Build" - xcode: "Xcode_12.4.app" runsOn: macOS-10.15 name: "macOS 10.15, SPM 5.3 Build" steps: - uses: actions/checkout@v2 - name: Install Firewalk run: brew install alamofire/alamofire/firewalk && firewalk & - name: Test SPM run: swift build -c debug Linux: name: Linux runs-on: ubuntu-20.04 container: image: swift:5.5.2-focal timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: SPM Linux build run: swift build --build-tests -c debug Linux_Nightly: name: Linux Nightly runs-on: ubuntu-20.04 container: image: swiftlang/swift:nightly-focal timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: SPM Linux build run: swift build --build-tests -c debug Windows: name: Windows runs-on: windows-2019 timeout-minutes: 10 steps: - name: "Clone Project" uses: actions/checkout@v2 - uses: seanmiddleditch/gha-setup-vsdevenv@master - name: Install Swift run: | 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") - name: Set Environment Variables run: | echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Adjust Paths run: | echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Install Supporting Files run: | Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap" Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap" Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes" Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap" - name: SPM Windows build shell: cmd run: | cd ${{ github.workspace}} set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk %SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1