Skip to content

Smoke test swiftly on nightly snapshot toolchains #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/nightly_snapshot_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Smoke Test - Nightly Swift Toolchain

on:
schedule:
- cron: '30 3 * * *'

env:
SWIFTLY_BOOTSTRAP_VERSION: 1.0.0

jobs:
tests-selfhosted:
name: Test (Smoke Test - Nightly Swift Toolchain) / ${{ 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 --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
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'
26 changes: 20 additions & 6 deletions scripts/prep-gh-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ while [ $# -ne 0 ]; do
--install-swiftly)
installSwiftly=true
;;
--swift-main-snapshot)
swiftMainSnapshot=true
;;
*)
;;
esac
Expand All @@ -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

if [ -f .swift-version ]; then
echo "Installing selected swift toolchain"
swiftly install --post-install-file=post-install.sh
selector=()
runSelector=()

if [ "$swiftMainSnapshot" == true ]; then
echo "Installing latest main-snapshot toolchain"
selector=("main-snapshot")
runSelector=("+main-snapshot")
elif [ -f .swift-version ]; then
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
swiftly run "${runSelector[@]}" swift --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