mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Reenable 6.1 CI workflows by default. ### Motivation: 6.1 workflows were disabled by default in https://github.com/apple/swift-nio/commit/d09ffc8ad6437bc278897279e33150d8e39ee3d5. However, we haven't been able to drop 6.1 in all repos using these workflows yet, so this PR temporarily reenables the 6.1 workflows until we can land that work everywhere else. ### Modifications: Reenable 6.1 CI workflows by default. ### Result: 6.1 workflows are enabled by default.
145 lines
6.6 KiB
YAML
145 lines
6.6 KiB
YAML
name: Benchmarks
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
benchmark_package_path:
|
|
type: string
|
|
description: "Path to the directory containing the benchmarking package. Defaults to ."
|
|
default: "."
|
|
swift_package_arguments:
|
|
type: string
|
|
description: "Arguments to the switch package command invocation e.g. `--disable-sandbox`"
|
|
linux_5_9_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to false."
|
|
default: false
|
|
linux_5_10_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to false."
|
|
default: false
|
|
linux_6_0_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to false."
|
|
default: false
|
|
linux_6_1_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
|
|
default: true
|
|
linux_6_2_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
|
|
default: true
|
|
linux_6_3_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.3 Swift version matrix job. Defaults to true."
|
|
default: true
|
|
linux_6_4_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.4 Swift version matrix job. Defaults to true."
|
|
default: true
|
|
linux_nightly_6_0_enabled:
|
|
type: boolean
|
|
description: "⚠️ Deprecated, we no longer run against 6.0 nightly."
|
|
default: false
|
|
linux_nightly_6_1_enabled:
|
|
type: boolean
|
|
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
|
|
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
|
|
default: true
|
|
|
|
windows_6_0_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Windows 6.0 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
|
|
default: false
|
|
windows_6_1_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Windows 6.1 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
|
|
default: false
|
|
windows_6_2_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Windows 6.2 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
|
|
default: false
|
|
windows_6_3_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Windows 6.3 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
|
|
default: false
|
|
windows_6_4_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Windows 6.4 Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
|
|
default: false
|
|
windows_nightly_6_0_enabled:
|
|
type: boolean
|
|
description: "⚠️ Deprecated, we no longer run against 6.0 nightly." # TODO: implement Windows benchmarking
|
|
default: false
|
|
windows_nightly_main_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Windows nightly main Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
|
|
default: false
|
|
|
|
linux_env_vars:
|
|
type: string
|
|
description: "Environment variables for Linux jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
|
|
default: "{}"
|
|
|
|
minimum_swift_version:
|
|
type: string
|
|
description: "Minimum Swift version to include in the matrix. Leave empty for auto-detection from Package.swift, specify a version like '6.0' to override, or set to 'none' to disable filtering."
|
|
default: ""
|
|
|
|
jobs:
|
|
construct-matrix-linux:
|
|
name: Construct Linux Benchmarks matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
benchmarks-matrix: '${{ steps.generate-matrix.outputs.benchmarks-matrix }}'
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- id: generate-matrix
|
|
run: |
|
|
# Validate JSON environment variables
|
|
linux_env_vars_json="$INPUT_LINUX_ENV_VARS"
|
|
|
|
if ! echo "$linux_env_vars_json" | jq empty 2>/dev/null; then
|
|
echo "Error: linux_env_vars is not valid JSON"
|
|
exit 1
|
|
fi
|
|
|
|
echo "benchmarks-matrix=$(curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | MATRIX_LINUX_ENV_VARS_JSON="${linux_env_vars_json}" bash)" >> "$GITHUB_OUTPUT"
|
|
env:
|
|
INPUT_LINUX_ENV_VARS: ${{ inputs.linux_env_vars }}
|
|
MATRIX_LINUX_COMMAND: "curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check_benchmark_thresholds.sh | BENCHMARK_PACKAGE_PATH=${{ inputs.benchmark_package_path }} bash"
|
|
MATRIX_LINUX_SETUP_COMMAND: "swift --version && apt-get update -y -q && apt-get install -y -q curl libjemalloc-dev && git config --global --add safe.directory /$(basename ${{ github.workspace }})"
|
|
MATRIX_MIN_SWIFT_VERSION: ${{ inputs.minimum_swift_version }}
|
|
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_6_1_ENABLED: ${{ inputs.linux_6_1_enabled }}
|
|
MATRIX_LINUX_6_2_ENABLED: ${{ inputs.linux_6_2_enabled }}
|
|
MATRIX_LINUX_6_3_ENABLED: ${{ inputs.linux_6_3_enabled }}
|
|
MATRIX_LINUX_6_4_ENABLED: ${{ inputs.linux_6_4_enabled }}
|
|
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_next_enabled }}
|
|
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}
|
|
|
|
benchmarks-linux:
|
|
name: Benchmarks
|
|
needs: construct-matrix-linux
|
|
# Workaround https://github.com/nektos/act/issues/1875
|
|
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
|
|
with:
|
|
name: "Benchmarks"
|
|
matrix_string: '${{ needs.construct-matrix-linux.outputs.benchmarks-matrix }}'
|