Skip to content

Commit 5edbace

Browse files
committed
Always use the current version of the scripts (Linux + Wasm)
This applies the changes previously made for Android to: - Linux - Linux Static SDK - Wasm SDK - Embedded Wasm SDK
1 parent 00b19f5 commit 5edbace

File tree

1 file changed

+89
-4
lines changed

1 file changed

+89
-4
lines changed

.github/workflows/swift_package_test.yml

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,27 @@ jobs:
314314
- name: Checkout repository
315315
uses: actions/checkout@v1
316316
if: ${{ matrix.os_version == 'amazonlinux2' }}
317+
- name: Checkout swiftlang/github-workflows repository
318+
if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
319+
uses: actions/checkout@v4
320+
with:
321+
repository: swiftlang/github-workflows
322+
path: github-workflows
323+
- name: Checkout swiftlang/github-workflows repository
324+
if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
325+
uses: actions/checkout@v1
326+
with:
327+
repository: swiftlang/github-workflows
328+
path: github-workflows
329+
ref: main
330+
- name: Determine script-root path
331+
id: script_path
332+
run: |
333+
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
334+
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
335+
else
336+
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
337+
fi
317338
- name: Provide token
318339
if: ${{ inputs.needs_token }}
319340
run: |
@@ -322,7 +343,7 @@ jobs:
322343
if: ${{ inputs.enable_cross_pr_testing && github.event_name == 'pull_request' }}
323344
run: |
324345
apt-get update && apt-get install -y curl
325-
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift
346+
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift
326347
swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}"
327348
- name: Set environment variables
328349
if: ${{ inputs.linux_env_vars }}
@@ -360,6 +381,27 @@ jobs:
360381
- name: Checkout repository
361382
uses: actions/checkout@v1
362383
if: ${{ matrix.os_version == 'amazonlinux2' }}
384+
- name: Checkout swiftlang/github-workflows repository
385+
if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
386+
uses: actions/checkout@v4
387+
with:
388+
repository: swiftlang/github-workflows
389+
path: github-workflows
390+
- name: Checkout swiftlang/github-workflows repository
391+
if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
392+
uses: actions/checkout@v1
393+
with:
394+
repository: swiftlang/github-workflows
395+
path: github-workflows
396+
ref: main
397+
- name: Determine script-root path
398+
id: script_path
399+
run: |
400+
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
401+
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
402+
else
403+
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
404+
fi
363405
- name: Provide token
364406
if: ${{ inputs.needs_token }}
365407
run: |
@@ -390,7 +432,7 @@ jobs:
390432
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
391433
exit 1
392434
fi
393-
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
435+
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \
394436
bash -s -- --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }}
395437
396438
wasm-sdk-build:
@@ -417,6 +459,27 @@ jobs:
417459
- name: Checkout repository
418460
uses: actions/checkout@v1
419461
if: ${{ matrix.os_version == 'amazonlinux2' }}
462+
- name: Checkout swiftlang/github-workflows repository
463+
if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
464+
uses: actions/checkout@v4
465+
with:
466+
repository: swiftlang/github-workflows
467+
path: github-workflows
468+
- name: Checkout swiftlang/github-workflows repository
469+
if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
470+
uses: actions/checkout@v1
471+
with:
472+
repository: swiftlang/github-workflows
473+
path: github-workflows
474+
ref: main
475+
- name: Determine script-root path
476+
id: script_path
477+
run: |
478+
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
479+
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
480+
else
481+
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
482+
fi
420483
- name: Provide token
421484
if: ${{ inputs.needs_token }}
422485
run: |
@@ -447,7 +510,7 @@ jobs:
447510
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
448511
exit 1
449512
fi
450-
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
513+
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \
451514
bash -s -- --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }}
452515
453516
embedded-wasm-sdk-build:
@@ -470,6 +533,27 @@ jobs:
470533
run: clang --version
471534
- name: Checkout repository
472535
uses: actions/checkout@v4
536+
- name: Checkout swiftlang/github-workflows repository
537+
if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
538+
uses: actions/checkout@v4
539+
with:
540+
repository: swiftlang/github-workflows
541+
path: github-workflows
542+
- name: Checkout swiftlang/github-workflows repository
543+
if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }}
544+
uses: actions/checkout@v1
545+
with:
546+
repository: swiftlang/github-workflows
547+
path: github-workflows
548+
ref: main
549+
- name: Determine script-root path
550+
id: script_path
551+
run: |
552+
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
553+
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
554+
else
555+
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
556+
fi
473557
- name: Provide token
474558
if: ${{ inputs.needs_token }}
475559
run: |
@@ -500,7 +584,7 @@ jobs:
500584
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
501585
exit 1
502586
fi
503-
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
587+
cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \
504588
bash -s -- --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }}
505589
506590
android-sdk-build:
@@ -540,6 +624,7 @@ jobs:
540624
with:
541625
repository: swiftlang/github-workflows
542626
path: github-workflows
627+
ref: main
543628
- name: Determine script-root path
544629
id: script_path
545630
run: |

0 commit comments

Comments
 (0)