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/scripts/install-and-build-with-sdk.sh b/.github/workflows/scripts/install-and-build-with-sdk.sh old mode 100644 new mode 100755 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 0376ab4..8637a1c 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 @@ -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 @@ -392,7 +391,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 @@ -420,20 +419,7 @@ 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 - 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 }}) @@ -470,7 +456,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 @@ -498,20 +484,7 @@ 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 - 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 }}) @@ -548,7 +521,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 @@ -576,20 +549,7 @@ 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 - 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 }}) @@ -627,7 +587,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 @@ -655,20 +615,7 @@ 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 - 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)