Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rnro committed Feb 25, 2025
1 parent 6c44e2d commit d32d489
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 40 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ on:
default: false
linux_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux nightly 6.1 Swift version matrix job. Defaults to true."
description: "⚠️ Deprecated, use linux_nightly_next_enabled."
default: true
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux nightly matrix job for the next Swift version. Defaults to true."
default: true
linux_nightly_main_enabled:
type: boolean
Expand Down Expand Up @@ -60,14 +64,14 @@ jobs:
with:
persist-credentials: false
- id: generate-matrix
run: echo "benchmarks-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
run: echo "benchmarks-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/nightly_next/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_COMMAND: "swift package --package-path ${{ inputs.benchmark_package_path }} ${{ inputs.swift_package_arguments }} benchmark baseline check --check-absolute-path ${{ inputs.benchmark_package_path }}/Thresholds/${SWIFT_VERSION}/"
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q libjemalloc-dev"
MATRIX_LINUX_5_9_ENABLED: ${{ inputs.linux_5_9_enabled }}
MATRIX_LINUX_5_10_ENABLED: ${{ inputs.linux_5_10_enabled }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_NIGHTLY_6_1_ENABLED: ${{ inputs.linux_nightly_6_1_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled && inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}

benchmarks:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/cxx_interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ on:
default: false
linux_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux nightly 6.0 Swift version matrix job. Defaults to true."
description: "⚠️ Deprecated, use linux_nightly_next_enabled."
default: true
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux matrix job using the nightly build for the next Swift version. Defaults to true."
default: true
linux_nightly_main_enabled:
type: boolean
Expand Down Expand Up @@ -53,14 +57,14 @@ jobs:
with:
persist-credentials: false
- id: generate-matrix
run: echo "cxx-interop-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
run: echo "cxx-interop-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/nightly_next/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_COMMAND: "curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-cxx-interop-compatibility.sh | bash"
MATRIX_LINUX_COMMAND: "curl -s https://raw.githubusercontent.com/apple/swift-nio/nightly_next/scripts/check-cxx-interop-compatibility.sh | bash"
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q curl jq"
MATRIX_LINUX_5_9_ENABLED: ${{ inputs.linux_5_9_enabled }}
MATRIX_LINUX_5_10_ENABLED: ${{ inputs.linux_5_10_enabled }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_NIGHTLY_6_1_ENABLED: ${{ inputs.linux_nightly_6_1_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled && inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}

cxx-interop:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ jobs:
unit-tests:
name: Unit tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
uses: apple/swift-nio/.github/workflows/unit_tests.yml@nightly_next
with:
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_next_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"

benchmarks:
name: Benchmarks
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
uses: apple/swift-nio/.github/workflows/benchmarks.yml@nightly_next
with:
benchmark_package_path: "Benchmarks"

cxx-interop:
name: Cxx interop
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@nightly_next

construct-integration-test-matrix:
name: Construct integration test matrix
Expand All @@ -45,7 +45,7 @@ jobs:
with:
persist-credentials: false
- id: generate-matrix
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/nightly_next/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq"
MATRIX_LINUX_COMMAND: "./scripts/integration_tests.sh"
Expand All @@ -54,7 +54,7 @@ jobs:
name: Integration tests
needs: construct-integration-test-matrix
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@nightly_next
with:
name: "Integration tests"
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
Expand Down
34 changes: 25 additions & 9 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ on:
default: ""
linux_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux nightly 6.1 Swift version matrix job. Defaults to true."
description: "⚠️ Deprecated, use linux_nightly_next_enabled."
default: true
linux_nightly_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux nightly 6.1 Swift version matrix job."
description: "⚠️ Deprecated, use linux_nightly_next_arguments_override."
default: ""
linux_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Linux matrix job using the nightly build for the next Swift version. Defaults to true."
default: true
linux_nightly_next_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux matrix job using the nightly build for the next Swift version."
default: ""
linux_nightly_main_enabled:
type: boolean
Expand Down Expand Up @@ -70,11 +78,19 @@ on:
default: ""
windows_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the Windows nightly 6.1 Swift version matrix job. Defaults to false."
description: "⚠️ Deprecated, use windows_nightly_next_enabled."
default: false
windows_nightly_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows nightly 6.1 Swift version matrix job."
description: "⚠️ Deprecated, use windows_nightly_next_arguments_override."
default: ""
windows_nightly_next_enabled:
type: boolean
description: "Boolean to enable the Windows matrix job using the nightly build for the next Swift version. Defaults to true."
default: true
windows_nightly_next_arguments_override:
type: string
description: "The arguments passed to swift test in the Windows matrix job using the nightly build for the next Swift version."
default: ""
windows_nightly_main_enabled:
type: boolean
Expand All @@ -97,7 +113,7 @@ jobs:
with:
persist-credentials: false
- id: generate-matrix
run: echo "unit-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
run: echo "unit-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/nightly_next/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_COMMAND: "swift test"
MATRIX_LINUX_5_9_ENABLED: ${{ inputs.linux_5_9_enabled }}
Expand All @@ -106,15 +122,15 @@ jobs:
MATRIX_LINUX_5_10_COMMAND_ARGUMENTS: ${{ inputs.linux_5_10_arguments_override }}
MATRIX_LINUX_6_0_ENABLED: ${{ inputs.linux_6_0_enabled }}
MATRIX_LINUX_6_0_COMMAND_ARGUMENTS: ${{ inputs.linux_6_0_arguments_override }}
MATRIX_LINUX_NIGHTLY_6_1_ENABLED: ${{ inputs.linux_nightly_6_1_enabled }}
MATRIX_LINUX_NIGHTLY_6_1_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_6_1_arguments_override }}
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled && inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_NEXT_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_6_1_arguments_override }} ${{ inputs.linux_nightly_next_arguments_override }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_COMMAND_ARGUMENTS: ${{ inputs.linux_nightly_main_arguments_override }}
MATRIX_WINDOWS_COMMAND: "swift test"
MATRIX_WINDOWS_6_0_ENABLED: ${{ inputs.windows_6_0_enabled }}
MATRIX_WINDOWS_6_0_COMMAND_ARGUMENTS: ${{ inputs.windows_6_0_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_6_1_ENABLED: ${{ inputs.windows_nightly_6_1_enabled }}
MATRIX_WINDOWS_NIGHTLY_6_1_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_6_1_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_NEXT_ENABLED: ${{ inputs.windows_nightly_6_1_enabled && inputs.windows_nightly_next_enabled }}
MATRIX_WINDOWS_NIGHTLY_NEXT_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_6_1_arguments_override }} ${{ inputs.windows_nightly_next_arguments_override }}
MATRIX_WINDOWS_NIGHTLY_MAIN_ENABLED: ${{ inputs.windows_nightly_main_enabled }}
MATRIX_WINDOWS_NIGHTLY_MAIN_COMMAND_ARGUMENTS: ${{ inputs.windows_nightly_main_arguments_override }}

Expand Down
36 changes: 18 additions & 18 deletions scripts/generate_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ linux_5_10_enabled="${MATRIX_LINUX_5_10_ENABLED:=true}"
linux_5_10_command_arguments="$MATRIX_LINUX_5_10_COMMAND_ARGUMENTS"
linux_6_0_enabled="${MATRIX_LINUX_6_0_ENABLED:=true}"
linux_6_0_command_arguments="$MATRIX_LINUX_6_0_COMMAND_ARGUMENTS"
linux_nightly_6_1_enabled="${MATRIX_LINUX_NIGHTLY_6_1_ENABLED:=true}"
linux_nightly_6_1_command_arguments="$MATRIX_LINUX_NIGHTLY_6_1_COMMAND_ARGUMENTS"
linux_nightly_next_enabled="${MATRIX_LINUX_NIGHTLY_NEXT_ENABLED:=${MATRIX_LINUX_NIGHTLY_6_1_ENABLED:=true}}"
linux_nightly_next_command_arguments="${MATRIX_LINUX_NIGHTLY_NEXT_COMMAND_ARGUMENTS:=${MATRIX_LINUX_NIGHTLY_6_1_COMMAND_ARGUMENTS}}"
linux_nightly_main_enabled="${MATRIX_LINUX_NIGHTLY_MAIN_ENABLED:=true}"
linux_nightly_main_command_arguments="$MATRIX_LINUX_NIGHTLY_MAIN_COMMAND_ARGUMENTS"

windows_command="$MATRIX_WINDOWS_COMMAND" # required if any Windows pipeline is enabled
windows_setup_command="$MATRIX_WINDOWS_SETUP_COMMAND"
windows_6_0_enabled="${MATRIX_WINDOWS_6_0_ENABLED:=false}"
windows_6_0_command_arguments="$MATRIX_WINDOWS_6_0_COMMAND_ARGUMENTS"
windows_nightly_6_1_enabled="${MATRIX_WINDOWS_NIGHTLY_6_1_ENABLED:=false}"
windows_nightly_6_1_command_arguments="$MATRIX_WINDOWS_NIGHTLY_6_1_COMMAND_ARGUMENTS"
windows_nightly_next_enabled="${MATRIX_WINDOWS_NIGHTLY_NEXT_ENABLED:=${MATRIX_WINDOWS_NIGHTLY_6_1_ENABLED:=false}}"
windows_nightly_next_command_arguments="${MATRIX_WINDOWS_NIGHTLY_NEXT_COMMAND_ARGUMENTS:=${MATRIX_WINDOWS_NIGHTLY_6_1_COMMAND_ARGUMENTS}}"
windows_nightly_main_enabled="${MATRIX_WINDOWS_NIGHTLY_MAIN_ENABLED:=false}"
windows_nightly_main_command_arguments="$MATRIX_WINDOWS_NIGHTLY_MAIN_COMMAND_ARGUMENTS"

Expand All @@ -41,13 +41,13 @@ linux_runner="ubuntu-latest"
linux_5_9_container_image="swift:5.9-jammy"
linux_5_10_container_image="swift:5.10-jammy"
linux_6_0_container_image="swift:6.0-jammy"
linux_nightly_6_1_container_image="swiftlang/swift:nightly-6.1-jammy"
linux_nightly_next_container_image="swiftlang/swift:nightly-6.1-jammy"
linux_nightly_main_container_image="swiftlang/swift:nightly-main-jammy"

windows_6_0_runner="windows-2022"
windows_6_0_container_image="swift:6.0-windowsservercore-ltsc2022"
windows_nightly_6_1_runner="windows-2019"
windows_nightly_6_1_container_image="swiftlang/swift:nightly-6.1-windowsservercore-1809"
windows_nightly_next_runner="windows-2019"
windows_nightly_next_container_image="swiftlang/swift:nightly-6.1-windowsservercore-1809"
windows_nightly_main_runner="windows-2019"
windows_nightly_main_container_image="swiftlang/swift:nightly-main-windowsservercore-1809"

Expand All @@ -56,7 +56,7 @@ matrix='{"config": []}'

## Linux
if [[ "$linux_5_9_enabled" == "true" || "$linux_5_10_enabled" == "true" || "$linux_6_0_enabled" == "true" || \
"$linux_nightly_6_1_enabled" == "true" || "$linux_nightly_main_enabled" == "true" ]]; then
"$linux_nightly_next_enabled" == "true" || "$linux_nightly_main_enabled" == "true" ]]; then
if [[ -z "$linux_command" ]]; then
echo "No linux command defined"; exit 1
fi
Expand Down Expand Up @@ -93,14 +93,14 @@ if [[ "$linux_6_0_enabled" == "true" ]]; then
'.config[.config| length] |= . + { "name": "6.0", "image": $container_image, "swift_version": "6.0", "platform": "Linux", "command": $command, "command_arguments": $command_arguments, "setup_command": $setup_command, "runner": $runner}')
fi

if [[ "$linux_nightly_6_1_enabled" == "true" ]]; then
if [[ "$linux_nightly_next_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$linux_setup_command" \
--arg command "$linux_command" \
--arg command_arguments "$linux_nightly_6_1_command_arguments" \
--arg container_image "$linux_nightly_6_1_container_image" \
--arg command_arguments "$linux_nightly_next_command_arguments" \
--arg container_image "$linux_nightly_next_container_image" \
--arg runner "$linux_runner" \
'.config[.config| length] |= . + { "name": "nightly-6.1", "image": $container_image, "swift_version": "nightly-6.1", "platform": "Linux", "command": $command, "command_arguments": $command_arguments, "setup_command": $setup_command, "runner": $runner}')
'.config[.config| length] |= . + { "name": "nightly-next", "image": $container_image, "swift_version": "nightly-6.1", "platform": "Linux", "command": $command, "command_arguments": $command_arguments, "setup_command": $setup_command, "runner": $runner}')
fi

if [[ "$linux_nightly_main_enabled" == "true" ]]; then
Expand All @@ -114,7 +114,7 @@ if [[ "$linux_nightly_main_enabled" == "true" ]]; then
fi

## Windows
if [[ "$windows_6_0_enabled" == "true" || "$windows_nightly_6_1_enabled" == "true" || "$windows_nightly_main_enabled" == "true" ]]; then
if [[ "$windows_6_0_enabled" == "true" || "$windows_nightly_next_enabled" == "true" || "$windows_nightly_main_enabled" == "true" ]]; then
if [[ -z "$windows_command" ]]; then
echo "No windows command defined"; exit 1
fi
Expand All @@ -130,14 +130,14 @@ if [[ "$windows_6_0_enabled" == "true" ]]; then
'.config[.config| length] |= . + { "name": "6.0", "image": $container_image, "swift_version": "6.0", "platform": "Windows", "command": $command, "command_arguments": $command_arguments, "setup_command": $setup_command, "runner": $runner }')
fi

if [[ "$windows_nightly_6_1_enabled" == "true" ]]; then
if [[ "$windows_nightly_next_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg setup_command "$windows_setup_command" \
--arg command "$windows_command" \
--arg command_arguments "$windows_nightly_6_1_command_arguments" \
--arg container_image "$windows_nightly_6_1_container_image" \
--arg runner "$windows_nightly_6_1_runner" \
'.config[.config| length] |= . + { "name": "nightly-6.1", "image": $container_image, "swift_version": "nightly-6.1", "platform": "Windows", "command": $command, "command_arguments": $command_arguments, "setup_command": $setup_command, "runner": $runner }')
--arg command_arguments "$windows_nightly_next_command_arguments" \
--arg container_image "$windows_nightly_next_container_image" \
--arg runner "$windows_nightly_next_runner" \
'.config[.config| length] |= . + { "name": "nightly-next", "image": $container_image, "swift_version": "nightly-6.1", "platform": "Windows", "command": $command, "command_arguments": $command_arguments, "setup_command": $setup_command, "runner": $runner }')
fi

if [[ "$windows_nightly_main_enabled" == "true" ]]; then
Expand Down

0 comments on commit d32d489

Please sign in to comment.