Skip to content

Add support for AsyncHTTPClient (#10) #54

Add support for AsyncHTTPClient (#10)

Add support for AsyncHTTPClient (#10) #54

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-macos:
name: Swift ${{ matrix.swift }} on macOS ${{ matrix.macos }} with Xcode ${{ matrix.xcode }}${{ matrix.variant == 'async_http_client' && ' (AsyncHTTPClient)' || '' }}
runs-on: macos-${{ matrix.macos }}
env:
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer"
strategy:
fail-fast: false
matrix:
include:
- swift: "6.1"
xcode: "16.3"
macos: "15"
variant: default
- swift: "6.2"
xcode: "26.0"
macos: "26"
variant: default
- swift: "6.1"
xcode: "16.3"
macos: "15"
variant: async_http_client
- swift: "6.2"
xcode: "26.0"
macos: "26"
variant: async_http_client
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Swift Package Manager dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/org.swift.swiftpm
.build
key: ${{ runner.os }}-swift-${{ matrix.swift }}-${{ matrix.variant }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-${{ matrix.swift }}-${{ matrix.variant }}-spm-
- name: Configure variant
run: |
if [ "${{ matrix.variant }}" = "async_http_client" ]; then
echo "SWIFT_VARIANT_ARGS=--traits AsyncHTTPClient --scratch-path .build/async-http-client" >> "$GITHUB_ENV"
else
echo "SWIFT_VARIANT_ARGS=--scratch-path .build/default" >> "$GITHUB_ENV"
fi
- name: Lint
run: swift format lint --strict --recursive .
- name: Build
run: swift build $SWIFT_VARIANT_ARGS
- name: Smoke test plugin
if: matrix.variant == 'default'
run: swift package --scratch-path .build/default plugin --allow-writing-to-package-directory replay --help
- name: Test
run: swift test $SWIFT_VARIANT_ARGS
test-linux:
name: Swift ${{ matrix.swift-version }} on Linux${{ matrix.variant == 'async_http_client' && ' (AsyncHTTPClient)' || '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- swift-version: "6.1.3"
variant: default
- swift-version: "6.2.3"
variant: default
- swift-version: "6.1.3"
variant: async_http_client
- swift-version: "6.2.3"
variant: async_http_client
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Swift
uses: vapor/swiftly-action@v0.2
with:
toolchain: ${{ matrix.swift-version }}
- name: Configure variant
run: |
if [ "${{ matrix.variant }}" = "async_http_client" ]; then
echo "SWIFT_VARIANT_ARGS=--traits AsyncHTTPClient --scratch-path .build/async-http-client" >> "$GITHUB_ENV"
else
echo "SWIFT_VARIANT_ARGS=--scratch-path .build/default" >> "$GITHUB_ENV"
fi
- name: Lint
run: swift format lint --strict --recursive .
- name: Build
run: swift build $SWIFT_VARIANT_ARGS
- name: Smoke test plugin
if: matrix.variant == 'default'
run: swift package --scratch-path .build/default plugin --allow-writing-to-package-directory replay --help
- name: Test
run: swift test $SWIFT_VARIANT_ARGS