From 8ed0ee7cde3ec9cea6557de3ec3e16a7f25de8da Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 18 Nov 2025 21:16:00 -0800 Subject: [PATCH 1/4] Add missing executable bit to install-and-build-with-sdk.sh script --- .github/workflows/scripts/install-and-build-with-sdk.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/workflows/scripts/install-and-build-with-sdk.sh diff --git a/.github/workflows/scripts/install-and-build-with-sdk.sh b/.github/workflows/scripts/install-and-build-with-sdk.sh old mode 100644 new mode 100755 From bbfd1ad78544fd076de4464f42d0d53f4c0d424d Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 18 Nov 2025 22:22:23 -0800 Subject: [PATCH 2/4] Don't use unnecessary piping This causes failures to be ignored when -o pipefail is not set. --- .github/workflows/swift_package_test.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index 0376ab4..675d296 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -432,8 +432,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ - bash -s -- --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }} + ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }} wasm-sdk-build: name: Swift SDK for Wasm Build (${{ matrix.swift_version }} - ${{ matrix.os_version }}) @@ -510,8 +509,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ - bash -s -- --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }} + ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }} embedded-wasm-sdk-build: name: Embedded Swift SDK for Wasm Build (${{ matrix.swift_version }} - ${{ matrix.os_version }}) @@ -588,8 +586,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ - bash -s -- --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }} + ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }} android-sdk-build: name: Swift SDK for Android Build (${{ matrix.swift_version }} - ${{ matrix.os_version }} - NDK ${{ matrix.ndk_version }}) @@ -667,8 +664,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ - bash -s -- --android --flags="$BUILD_FLAGS" --build-command="${{ inputs.android_sdk_build_command }}" --android-sdk-triple=${{ join(fromJson(inputs.android_sdk_triples), ' --android-sdk-triple=') }} --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }} + ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --android --flags="$BUILD_FLAGS" --build-command="${{ inputs.android_sdk_build_command }}" --android-sdk-triple=${{ join(fromJson(inputs.android_sdk_triples), ' --android-sdk-triple=') }} --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }} windows-build: name: Windows (${{ matrix.swift_version }} - windows-2022) From 981d04b687b58e10f177b9093b6bfcc1c9fc8d30 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 19 Nov 2025 00:32:42 -0800 Subject: [PATCH 3/4] Check out github-workflows into subdirectory checkout@v1 and checkout@v4 differ in their behavior, try to make v1 clone the workflows repo in the same place as v4. --- .github/workflows/swift_package_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index 675d296..7790073 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -325,7 +325,7 @@ jobs: uses: actions/checkout@v1 with: repository: swiftlang/github-workflows - path: github-workflows + path: ${{ github.event.repository.name }}/github-workflows ref: main - name: Determine script-root path id: script_path @@ -392,7 +392,7 @@ jobs: uses: actions/checkout@v1 with: repository: swiftlang/github-workflows - path: github-workflows + path: ${{ github.event.repository.name }}/github-workflows ref: main - name: Determine script-root path id: script_path @@ -469,7 +469,7 @@ jobs: uses: actions/checkout@v1 with: repository: swiftlang/github-workflows - path: github-workflows + path: ${{ github.event.repository.name }}/github-workflows ref: main - name: Determine script-root path id: script_path @@ -546,7 +546,7 @@ jobs: uses: actions/checkout@v1 with: repository: swiftlang/github-workflows - path: github-workflows + path: ${{ github.event.repository.name }}/github-workflows ref: main - name: Determine script-root path id: script_path @@ -624,7 +624,7 @@ jobs: uses: actions/checkout@v1 with: repository: swiftlang/github-workflows - path: github-workflows + path: ${{ github.event.repository.name }}/github-workflows ref: main - name: Determine script-root path id: script_path From d4d99bff4aa4cd8fe2ff94a85cc93014e0f95e0c Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 20 Nov 2025 00:26:48 -0800 Subject: [PATCH 4/4] Stop installing curl when we don't need it This can save tens of seconds on some of the soundness checks. --- .github/workflows/scripts/check-docs.sh | 2 +- .github/workflows/soundness.yml | 14 +++---- .github/workflows/swift_package_test.yml | 49 ------------------------ 3 files changed, 6 insertions(+), 59 deletions(-) diff --git a/.github/workflows/scripts/check-docs.sh b/.github/workflows/scripts/check-docs.sh index 5c4fb02..f170af1 100755 --- a/.github/workflows/scripts/check-docs.sh +++ b/.github/workflows/scripts/check-docs.sh @@ -23,7 +23,7 @@ if [ ! -f .spi.yml ]; then fi if ! command -v yq &> /dev/null; then - fatal "yq could not be found. Please install yq to proceed." + apt -q update && apt -yq install yq fi package_files=$(find . -maxdepth 1 -name 'Package*.swift') diff --git a/.github/workflows/soundness.yml b/.github/workflows/soundness.yml index 6c8aad2..95e5e7f 100644 --- a/.github/workflows/soundness.yml +++ b/.github/workflows/soundness.yml @@ -162,9 +162,7 @@ jobs: - name: Run documentation check env: ADDITIONAL_DOCC_ARGUMENTS: ${{ inputs.docs_check_additional_arguments }} - run: | - which curl yq || (apt -q update && apt -yq install curl yq) - cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-docs.sh | bash + run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-docs.sh unacceptable-language-check: name: Unacceptable language check @@ -194,7 +192,7 @@ jobs: - name: Run unacceptable language check env: UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}} - run: cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-unacceptable-language.sh | bash + run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-unacceptable-language.sh license-header-check: name: License headers check @@ -224,7 +222,7 @@ jobs: - name: Run license header check env: PROJECT_NAME: ${{ inputs.license_header_check_project_name }} - run: cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-license-header.sh | bash + run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-license-header.sh broken-symlink-check: name: Broken symlinks check @@ -252,7 +250,7 @@ jobs: echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT fi - name: Run broken symlinks check - run: cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-broken-symlinks.sh | bash + run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-broken-symlinks.sh format-check: name: Format check @@ -285,9 +283,7 @@ jobs: # https://github.com/actions/checkout/issues/766 run: git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Run format check - run: | - which curl || (apt -q update && apt -yq install curl) - cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-swift-format.sh | bash + run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-swift-format.sh shell-check: name: Shell check diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index 7790073..8637a1c 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -342,7 +342,6 @@ jobs: - name: Check out related PRs if: ${{ inputs.enable_cross_pr_testing && github.event_name == 'pull_request' }} run: | - apt-get update && apt-get install -y curl cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}" - name: Set environment variables @@ -420,18 +419,6 @@ jobs: BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} run: | ${{ inputs.linux_static_sdk_pre_build_command }} - if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal - apt-get -q update && apt-get -yq install curl - elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9 - dnf -y update - dnf -y install curl-minimal - elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2 - yum -y update - yum -y install curl - else - echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 - exit 1 - fi ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }} wasm-sdk-build: @@ -497,18 +484,6 @@ jobs: BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} run: | ${{ inputs.wasm_sdk_pre_build_command }} - if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal - apt-get -q update && apt-get -yq install curl - elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9 - dnf -y update - dnf -y install curl-minimal - elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2 - yum -y update - yum -y install curl - else - echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 - exit 1 - fi ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }} embedded-wasm-sdk-build: @@ -574,18 +549,6 @@ jobs: BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} run: | ${{ inputs.wasm_sdk_pre_build_command }} - if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal - apt-get -q update && apt-get -yq install curl - elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9 - dnf -y update - dnf -y install curl-minimal - elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2 - yum -y update - yum -y install curl - else - echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 - exit 1 - fi ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }} android-sdk-build: @@ -652,18 +615,6 @@ jobs: BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }} run: | ${{ inputs.android_sdk_pre_build_command }} - if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal - apt-get -q update && apt-get -yq install curl - elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9 - dnf -y update - dnf -y install curl-minimal - elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2 - yum -y update - yum -y install curl - else - echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 - exit 1 - fi ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --android --flags="$BUILD_FLAGS" --build-command="${{ inputs.android_sdk_build_command }}" --android-sdk-triple=${{ join(fromJson(inputs.android_sdk_triples), ' --android-sdk-triple=') }} --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }} windows-build: