Skip to content

Commit 0004868

Browse files
authored
Smoke test swiftly on nightly snapshot toolchains (#337)
* Add a scheduled github workflow to check swiftly preparedness for the next swift toolchain release * Use the selected swift toolchain for the libarchive script
1 parent ce59935 commit 0004868

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Smoke Test - Nightly Swift Toolchain
2+
3+
on:
4+
schedule:
5+
- cron: '30 3 * * *'
6+
7+
env:
8+
SWIFTLY_BOOTSTRAP_VERSION: 1.0.0
9+
10+
jobs:
11+
tests-selfhosted:
12+
name: Test (Smoke Test - Nightly Swift Toolchain) / ${{ matrix.container }}
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12", "fedora:39"]
18+
container:
19+
image: ${{ matrix.container }}
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
- name: Prepare the action
24+
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-main-snapshot
25+
- name: Build and Test
26+
# UBI 9 and Ubuntu 20.04 - See https://github.com/swiftlang/swift/issues/80908
27+
# UBI 9 - See https://github.com/swiftlang/swift/issues/80909
28+
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'

scripts/prep-gh-action.sh

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ while [ $# -ne 0 ]; do
1616
--install-swiftly)
1717
installSwiftly=true
1818
;;
19+
--swift-main-snapshot)
20+
swiftMainSnapshot=true
21+
;;
1922
*)
2023
;;
2124
esac
@@ -34,23 +37,34 @@ if [ "$installSwiftly" == true ]; then
3437
echo "PATH=$PATH" >> "$GITHUB_ENV" && echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV" && echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"
3538
fi
3639

37-
if [ -f .swift-version ]; then
38-
echo "Installing selected swift toolchain"
39-
swiftly install --post-install-file=post-install.sh
40+
selector=()
41+
runSelector=()
42+
43+
if [ "$swiftMainSnapshot" == true ]; then
44+
echo "Installing latest main-snapshot toolchain"
45+
selector=("main-snapshot")
46+
runSelector=("+main-snapshot")
47+
elif [ -f .swift-version ]; then
48+
echo "Installing selected swift toolchain from .swift-version file"
49+
selector=()
50+
runSelector=()
4051
else
4152
echo "Installing latest toolchain"
42-
swiftly install --post-install-file=post-install.sh latest
53+
selector=("latest")
54+
runSelector=("+latest")
4355
fi
4456

57+
swiftly install --post-install-file=post-install.sh "${selector[@]}"
58+
4559
if [ -f post-install.sh ]; then
4660
echo "Performing swift toolchain post-installation"
4761
chmod u+x post-install.sh && ./post-install.sh
4862
fi
4963

5064
echo "Displaying swift version"
51-
swift --version
65+
swiftly run "${runSelector[@]}" swift --version
5266

53-
CC=clang swiftly run "$(dirname "$0")/install-libarchive.sh"
67+
CC=clang swiftly run "${runSelector[@]}" "$(dirname "$0")/install-libarchive.sh"
5468
else
5569
"$(dirname "$0")/install-libarchive.sh"
5670
fi

0 commit comments

Comments
 (0)