Skip to content

Commit db49620

Browse files
authored
Static sdk allow custom args (#3377)
Allow custom argument specification in the Static SDK workflow ### Motivation: Sometimes users may want to specify more/different parameters such as specifying building only some targets ### Modifications: Add a parameter for the build arguments ### Result: More flexible SDK CI. You can see this in action here https://github.com/apple/swift-nio/actions/runs/17858707940/job/50783709148?pr=3377
1 parent f2ebedb commit db49620

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/static_sdk.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
type: string
88
description: "Environment variables for jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
99
default: "{}"
10+
command_arguments:
11+
type: string
12+
description: "The arguments passed to swift build. Defaults to '--swift-sdk x86_64-swift-linux-musl'."
13+
default: "--swift-sdk x86_64-swift-linux-musl"
1014

1115
jobs:
1216
construct-matrix:
@@ -42,7 +46,7 @@ jobs:
4246
"image":"ubuntu:jammy",
4347
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_static_sdk.sh | INSTALL_SWIFT_STATIC_SDK_VERSION=latest INSTALL_SWIFT_STATIC_SDK_ARCH=x86_64 bash && hash -r",
4448
"command":"swift build",
45-
"command_arguments":"--swift-sdk x86_64-swift-linux-musl",
49+
"command_arguments":"${{ inputs.command_arguments }}",
4650
"env":'"$env_vars_json"'
4751
},
4852
{
@@ -53,7 +57,7 @@ jobs:
5357
"image":"ubuntu:jammy",
5458
"setup_command":"apt update -q && apt install -y -q curl jq tar && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_prerequisites.sh | bash && curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_static_sdk.sh | INSTALL_SWIFT_STATIC_SDK_BRANCH=main INSTALL_SWIFT_STATIC_SDK_ARCH=x86_64 bash && hash -r",
5559
"command":"swift build",
56-
"command_arguments":"--swift-sdk x86_64-swift-linux-musl",
60+
"command_arguments":"${{ inputs.command_arguments }}",
5761
"env":'"$env_vars_json"'
5862
}
5963
]

0 commit comments

Comments
 (0)