From 237ce4af84aeab3a3a294916ac3351615513fe99 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 16:53:34 -0400 Subject: [PATCH 1/7] Add a scheduled github workflow to check swiftly preparedness for the next swift toolchain release --- .github/workflows/nightly_snapshot_check.yml | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/nightly_snapshot_check.yml diff --git a/.github/workflows/nightly_snapshot_check.yml b/.github/workflows/nightly_snapshot_check.yml new file mode 100644 index 00000000..a554971a --- /dev/null +++ b/.github/workflows/nightly_snapshot_check.yml @@ -0,0 +1,31 @@ +on: + schedule: + - cron: '30 3 * * *' + # TODO REMOVE THESE + pull_request: + types: [opened, reopened, synchronize] + +env: + SWIFTLY_BOOTSTRAP_VERSION: 1.0.0 + +jobs: + tests-selfhosted: + name: Test (Self Hosted) / ${{ matrix.container }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12", "fedora:39"] + container: + image: ${{ matrix.container }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Prepare the action + run: ./scripts/prep-gh-action.sh --install-swiftly + - name: Install main-snapshot toolchain + run: swiftly install main-snapshot + - name: Build and Test + # UBI 9 and Ubuntu 20.04 - See https://github.com/swiftlang/swift/issues/80908 + # UBI 9 - See https://github.com/swiftlang/swift/issues/80909 + run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swiftly run +main-snapshot swift build --build-tests; elif [[ "${{ matrix.container }}" == "ubuntu:20.04" ]]; then swiftly run +main-snapshot swift build --build-tests; else swiftly run +main-snapshot swift test; fi' From 693196abadb797a38b8c7b1a82223bd2bd9d2180 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 17:04:17 -0400 Subject: [PATCH 2/7] Remove the pull request trigger --- .github/workflows/nightly_snapshot_check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/nightly_snapshot_check.yml b/.github/workflows/nightly_snapshot_check.yml index a554971a..1c10286c 100644 --- a/.github/workflows/nightly_snapshot_check.yml +++ b/.github/workflows/nightly_snapshot_check.yml @@ -1,9 +1,6 @@ on: schedule: - cron: '30 3 * * *' - # TODO REMOVE THESE - pull_request: - types: [opened, reopened, synchronize] env: SWIFTLY_BOOTSTRAP_VERSION: 1.0.0 From b549441ffaa8ff118ecfa3c89c181d046ccaa9e8 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 17:16:29 -0400 Subject: [PATCH 3/7] Use the selected swift toolchain for the libarchive script --- .github/workflows/nightly_snapshot_check.yml | 9 ++++---- scripts/prep-gh-action.sh | 24 ++++++++++++++++---- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nightly_snapshot_check.yml b/.github/workflows/nightly_snapshot_check.yml index 1c10286c..998b33cb 100644 --- a/.github/workflows/nightly_snapshot_check.yml +++ b/.github/workflows/nightly_snapshot_check.yml @@ -1,13 +1,16 @@ on: schedule: - cron: '30 3 * * *' + # TODO REMOVE THESE + pull_request: + types: [opened, reopened, synchronize] env: SWIFTLY_BOOTSTRAP_VERSION: 1.0.0 jobs: tests-selfhosted: - name: Test (Self Hosted) / ${{ matrix.container }} + name: Test (Smoke Test - Nightly Swift Toolchain) / ${{ matrix.container }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -19,9 +22,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Prepare the action - run: ./scripts/prep-gh-action.sh --install-swiftly - - name: Install main-snapshot toolchain - run: swiftly install main-snapshot + run: ./scripts/prep-gh-action.sh --install-swiftly --swift-main-snapshot - name: Build and Test # UBI 9 and Ubuntu 20.04 - See https://github.com/swiftlang/swift/issues/80908 # UBI 9 - See https://github.com/swiftlang/swift/issues/80909 diff --git a/scripts/prep-gh-action.sh b/scripts/prep-gh-action.sh index 38f8f91c..4b475af5 100755 --- a/scripts/prep-gh-action.sh +++ b/scripts/prep-gh-action.sh @@ -16,6 +16,9 @@ while [ $# -ne 0 ]; do --install-swiftly) installSwiftly=true ;; + --swift-main-snapshot) + swiftMainSnapshot=true + ;; *) ;; esac @@ -34,23 +37,34 @@ if [ "$installSwiftly" == true ]; then echo "PATH=$PATH" >> "$GITHUB_ENV" && echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV" && echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV" fi + selector=() + runSelector=() + + if [ "$swiftMainSnapshot" == true ]; then + echo "Installing latest main-snapshot toolchain" + selector=("main-snapshot") + runSelector=("+main-snapshot") if [ -f .swift-version ]; then - echo "Installing selected swift toolchain" - swiftly install --post-install-file=post-install.sh + echo "Installing selected swift toolchain from .swift-version file" + selector=() + runSelector=() else echo "Installing latest toolchain" - swiftly install --post-install-file=post-install.sh latest + selector=("latest") + runSelector=("+latest") fi + swiftly install --post-install-file=post-install.sh "${selector[@]}" + if [ -f post-install.sh ]; then echo "Performing swift toolchain post-installation" chmod u+x post-install.sh && ./post-install.sh fi echo "Displaying swift version" - swift --version + swift "${selector[@]} --version - CC=clang swiftly run "$(dirname "$0")/install-libarchive.sh" + CC=clang swiftly run "${runSelector[@]}" "$(dirname "$0")/install-libarchive.sh" else "$(dirname "$0")/install-libarchive.sh" fi From f3bbc5a8e0f9094bdcb8766cd4265eb9df6af761 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 17:18:06 -0400 Subject: [PATCH 4/7] Fix the prep script --- scripts/prep-gh-action.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/prep-gh-action.sh b/scripts/prep-gh-action.sh index 4b475af5..2bca0a4e 100755 --- a/scripts/prep-gh-action.sh +++ b/scripts/prep-gh-action.sh @@ -62,7 +62,7 @@ if [ "$installSwiftly" == true ]; then fi echo "Displaying swift version" - swift "${selector[@]} --version + swiftly run "${runSelector[@]}" swift --version CC=clang swiftly run "${runSelector[@]}" "$(dirname "$0")/install-libarchive.sh" else From 4cdcecd299a77c5d5ebc326203b3beb4adb58118 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 17:19:22 -0400 Subject: [PATCH 5/7] Fix the prep script --- scripts/prep-gh-action.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/prep-gh-action.sh b/scripts/prep-gh-action.sh index 2bca0a4e..85e4033a 100755 --- a/scripts/prep-gh-action.sh +++ b/scripts/prep-gh-action.sh @@ -44,7 +44,7 @@ if [ "$installSwiftly" == true ]; then echo "Installing latest main-snapshot toolchain" selector=("main-snapshot") runSelector=("+main-snapshot") - if [ -f .swift-version ]; then + elif [ -f .swift-version ]; then echo "Installing selected swift toolchain from .swift-version file" selector=() runSelector=() From 680d65464e22ba663660c559cef9c2951545cb22 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 17:26:16 -0400 Subject: [PATCH 6/7] Remove the pull request trigger --- .github/workflows/nightly_snapshot_check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/nightly_snapshot_check.yml b/.github/workflows/nightly_snapshot_check.yml index 998b33cb..75c5d5f5 100644 --- a/.github/workflows/nightly_snapshot_check.yml +++ b/.github/workflows/nightly_snapshot_check.yml @@ -1,9 +1,6 @@ on: schedule: - cron: '30 3 * * *' - # TODO REMOVE THESE - pull_request: - types: [opened, reopened, synchronize] env: SWIFTLY_BOOTSTRAP_VERSION: 1.0.0 From dc57cb20a92e8df069f4711af4645a16342bf9cc Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 28 Apr 2025 17:41:57 -0400 Subject: [PATCH 7/7] Set the workflow name --- .github/workflows/nightly_snapshot_check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nightly_snapshot_check.yml b/.github/workflows/nightly_snapshot_check.yml index 75c5d5f5..6a395cd9 100644 --- a/.github/workflows/nightly_snapshot_check.yml +++ b/.github/workflows/nightly_snapshot_check.yml @@ -1,3 +1,5 @@ +name: Smoke Test - Nightly Swift Toolchain + on: schedule: - cron: '30 3 * * *'