Skip to content

Commit d4d99bf

Browse files
committed
Stop installing curl when we don't need it
This can save tens of seconds on some of the soundness checks.
1 parent 981d04b commit d4d99bf

File tree

3 files changed

+6
-59
lines changed

3 files changed

+6
-59
lines changed

.github/workflows/scripts/check-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [ ! -f .spi.yml ]; then
2323
fi
2424

2525
if ! command -v yq &> /dev/null; then
26-
fatal "yq could not be found. Please install yq to proceed."
26+
apt -q update && apt -yq install yq
2727
fi
2828

2929
package_files=$(find . -maxdepth 1 -name 'Package*.swift')

.github/workflows/soundness.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ jobs:
162162
- name: Run documentation check
163163
env:
164164
ADDITIONAL_DOCC_ARGUMENTS: ${{ inputs.docs_check_additional_arguments }}
165-
run: |
166-
which curl yq || (apt -q update && apt -yq install curl yq)
167-
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-docs.sh | bash
165+
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-docs.sh
168166

169167
unacceptable-language-check:
170168
name: Unacceptable language check
@@ -194,7 +192,7 @@ jobs:
194192
- name: Run unacceptable language check
195193
env:
196194
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}}
197-
run: cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-unacceptable-language.sh | bash
195+
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-unacceptable-language.sh
198196

199197
license-header-check:
200198
name: License headers check
@@ -224,7 +222,7 @@ jobs:
224222
- name: Run license header check
225223
env:
226224
PROJECT_NAME: ${{ inputs.license_header_check_project_name }}
227-
run: cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-license-header.sh | bash
225+
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-license-header.sh
228226

229227
broken-symlink-check:
230228
name: Broken symlinks check
@@ -252,7 +250,7 @@ jobs:
252250
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
253251
fi
254252
- name: Run broken symlinks check
255-
run: cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-broken-symlinks.sh | bash
253+
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-broken-symlinks.sh
256254

257255
format-check:
258256
name: Format check
@@ -285,9 +283,7 @@ jobs:
285283
# https://github.com/actions/checkout/issues/766
286284
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
287285
- name: Run format check
288-
run: |
289-
which curl || (apt -q update && apt -yq install curl)
290-
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-swift-format.sh | bash
286+
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-swift-format.sh
291287

292288
shell-check:
293289
name: Shell check

.github/workflows/swift_package_test.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ jobs:
342342
- name: Check out related PRs
343343
if: ${{ inputs.enable_cross_pr_testing && github.event_name == 'pull_request' }}
344344
run: |
345-
apt-get update && apt-get install -y curl
346345
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift
347346
swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}"
348347
- name: Set environment variables
@@ -420,18 +419,6 @@ jobs:
420419
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
421420
run: |
422421
${{ inputs.linux_static_sdk_pre_build_command }}
423-
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
424-
apt-get -q update && apt-get -yq install curl
425-
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
426-
dnf -y update
427-
dnf -y install curl-minimal
428-
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
429-
yum -y update
430-
yum -y install curl
431-
else
432-
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
433-
exit 1
434-
fi
435422
${{ 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 }}
436423
437424
wasm-sdk-build:
@@ -497,18 +484,6 @@ jobs:
497484
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
498485
run: |
499486
${{ inputs.wasm_sdk_pre_build_command }}
500-
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
501-
apt-get -q update && apt-get -yq install curl
502-
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
503-
dnf -y update
504-
dnf -y install curl-minimal
505-
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
506-
yum -y update
507-
yum -y install curl
508-
else
509-
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
510-
exit 1
511-
fi
512487
${{ 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 }}
513488
514489
embedded-wasm-sdk-build:
@@ -574,18 +549,6 @@ jobs:
574549
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
575550
run: |
576551
${{ inputs.wasm_sdk_pre_build_command }}
577-
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
578-
apt-get -q update && apt-get -yq install curl
579-
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
580-
dnf -y update
581-
dnf -y install curl-minimal
582-
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
583-
yum -y update
584-
yum -y install curl
585-
else
586-
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
587-
exit 1
588-
fi
589552
${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }}
590553
591554
android-sdk-build:
@@ -652,18 +615,6 @@ jobs:
652615
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
653616
run: |
654617
${{ inputs.android_sdk_pre_build_command }}
655-
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
656-
apt-get -q update && apt-get -yq install curl
657-
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
658-
dnf -y update
659-
dnf -y install curl-minimal
660-
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
661-
yum -y update
662-
yum -y install curl
663-
else
664-
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
665-
exit 1
666-
fi
667618
${{ 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 }}
668619
669620
windows-build:

0 commit comments

Comments
 (0)