Skip to content

Commit b549441

Browse files
committed
Use the selected swift toolchain for the libarchive script
1 parent 693196a commit b549441

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.github/workflows/nightly_snapshot_check.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
on:
22
schedule:
33
- cron: '30 3 * * *'
4+
# TODO REMOVE THESE
5+
pull_request:
6+
types: [opened, reopened, synchronize]
47

58
env:
69
SWIFTLY_BOOTSTRAP_VERSION: 1.0.0
710

811
jobs:
912
tests-selfhosted:
10-
name: Test (Self Hosted) / ${{ matrix.container }}
13+
name: Test (Smoke Test - Nightly Swift Toolchain) / ${{ matrix.container }}
1114
runs-on: ubuntu-latest
1215
strategy:
1316
fail-fast: false
@@ -19,9 +22,7 @@ jobs:
1922
- name: Checkout repository
2023
uses: actions/checkout@v4
2124
- name: Prepare the action
22-
run: ./scripts/prep-gh-action.sh --install-swiftly
23-
- name: Install main-snapshot toolchain
24-
run: swiftly install main-snapshot
25+
run: ./scripts/prep-gh-action.sh --install-swiftly --swift-main-snapshot
2526
- name: Build and Test
2627
# UBI 9 and Ubuntu 20.04 - See https://github.com/swiftlang/swift/issues/80908
2728
# UBI 9 - See https://github.com/swiftlang/swift/issues/80909

scripts/prep-gh-action.sh

Lines changed: 19 additions & 5 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

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")
3747
if [ -f .swift-version ]; then
38-
echo "Installing selected swift toolchain"
39-
swiftly install --post-install-file=post-install.sh
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+
swift "${selector[@]} --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)