mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
Motivation * The workflows this repository calls are one per job kind (`unit_tests.yml`, `release_builds.yml`, `cxx_interop.yml`, `static_sdk.yml`, `macos_tests.yml`, `benchmarks.yml`), two of the matrices are built by `curl`ing a script from another repository, and the unified workflows in `swiftlang/github-workflows` replace all of them with one matrix generated from the call's inputs. Modifications * Replaced the unit test, Cxx interop, release build, static SDK and macOS jobs with a `tests` call to `package_test.yml`, with `Debug-Test` and `Release-Build` as labeled commands. * Named the Swift versions in the lists, since four releases are supported and the thresholds are files named for versions, and stated the list once as a YAML anchor. * Wrote the per-version arguments as a `default` plus the one version that differs. * Moved benchmarks to the unified `benchmarks.yml`, and h2spec and the integration tests to `toolchain_matrix.yml` with `execute_matrix.yml`. * Renamed the committed `nightly-next` thresholds to `nightly-release`. * Opted out of the checks this package does not run: Windows, macOS with swiftly, and the Wasm, Embedded Wasm and Android builds. Result * The same platforms and Swift versions are exercised through the unified workflows. * The calls follow `main` of the unified workflows until a release is cut, when they should be pinned to its tag.
103 lines
3.5 KiB
YAML
103 lines
3.5 KiB
YAML
name: PR
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
|
|
jobs:
|
|
# Soundness
|
|
soundness:
|
|
name: Soundness
|
|
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.7
|
|
with:
|
|
license_header_check_project_name: "SwiftNIO"
|
|
|
|
tests:
|
|
name: Tests
|
|
uses: swiftlang/github-workflows/.github/workflows/package_test.yml@main
|
|
with:
|
|
# Linux
|
|
linux_swift_versions: &linux_swift_versions '["6.1", "6.2", "6.3", "6.4", "nightly-release", "nightly-main"]'
|
|
linux_version_overrides: |
|
|
default: -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error
|
|
nightly-main: --explicit-target-dependency-import-check error
|
|
linux_command: |
|
|
Debug-Test: swift test
|
|
Release-Build: swift build -c release
|
|
|
|
# macOS
|
|
macos_runner_pool: general
|
|
macos_swift_versions: '["6.1", "6.2", "6.3", "6.4"]'
|
|
macos_xcode_versions: '["latest-beta"]'
|
|
xcode_scheme: swift-nio-http2-Package
|
|
xcode_targets: '[macOS, iOS, watchOS, tvOS, visionOS]'
|
|
|
|
# Not yet supported
|
|
enable_windows: false
|
|
enable_macos_swiftly: false
|
|
enable_wasm_sdk_build: false
|
|
enable_embedded_wasm_sdk_build: false
|
|
enable_android_sdk_build: false
|
|
enable_android_emulator_tests: false
|
|
|
|
# Benchmarks
|
|
benchmarks:
|
|
name: Benchmarks
|
|
uses: swiftlang/github-workflows/.github/workflows/benchmarks.yml@main
|
|
with:
|
|
benchmark_package_paths: '["Benchmarks"]'
|
|
linux_swift_versions: *linux_swift_versions
|
|
|
|
# h2spec
|
|
construct-h2spec-matrix:
|
|
name: Construct h2spec matrix
|
|
uses: swiftlang/github-workflows/.github/workflows/toolchain_matrix.yml@main
|
|
with:
|
|
linux_swift_versions: *linux_swift_versions
|
|
|
|
h2spec:
|
|
name: HTTP/2 spec tests
|
|
needs: construct-h2spec-matrix
|
|
uses: swiftlang/github-workflows/.github/workflows/execute_matrix.yml@main
|
|
with:
|
|
name: h2spec
|
|
matrix_yaml_string: ${{ needs.construct-h2spec-matrix.outputs.matrix_yaml }}
|
|
# The job runs unprivileged on the runner but as root in a container, where
|
|
# sudo is not installed.
|
|
setup_command: |
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
sudo apt-get update -y -q && sudo apt-get install -y -q wget lsof
|
|
else
|
|
apt-get update -y -q && apt-get install -y -q wget lsof
|
|
fi
|
|
mkdir -p "$HOME/.tools"
|
|
wget -q https://github.com/summerwind/h2spec/releases/download/v2.2.1/h2spec_linux_amd64.tar.gz -O "$HOME/.tools/h2spec.tar.gz"
|
|
tar xzf "$HOME/.tools/h2spec.tar.gz" --directory "$HOME/.tools"
|
|
export PATH="$PATH:$HOME/.tools"
|
|
command: ./scripts/test_h2spec.sh
|
|
|
|
# Integration tests
|
|
construct-integration-tests-matrix:
|
|
name: Construct Integration Tests matrix
|
|
uses: swiftlang/github-workflows/.github/workflows/toolchain_matrix.yml@main
|
|
with:
|
|
linux_swift_versions: *linux_swift_versions
|
|
|
|
integration-tests:
|
|
name: Integration Tests
|
|
needs: construct-integration-tests-matrix
|
|
uses: swiftlang/github-workflows/.github/workflows/execute_matrix.yml@main
|
|
with:
|
|
name: integration-tests
|
|
matrix_yaml_string: ${{ needs.construct-integration-tests-matrix.outputs.matrix_yaml }}
|
|
setup_command: |
|
|
if command -v sudo >/dev/null 2>&1; then
|
|
sudo apt-get update -y -q && sudo apt-get install -y -q jq
|
|
else
|
|
apt-get update -y -q && apt-get install -y -q jq
|
|
fi
|
|
command: ./scripts/integration_tests.sh
|