-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert workflows to self-hosted with Swiftly (#195)
Test with self-hosted swiftly. Prepare the docker image before trying to install swiftly. Correct the swiftly install option. Update the GitHub prep script to work with/without swiftly. Use swiftly to run the install libarchive script for the C compiler. Move proxy circularity check out of swiftly run and into the proxy. Pre-install git so that the checkout clones the repo instead of using REST to fetch it. Remove unnecessary packages for C++ compilation.
- Loading branch information
1 parent
51496e5
commit 0cc4642
Showing
6 changed files
with
109 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.0 | ||
6.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,56 @@ | ||
#!/bin/bash | ||
|
||
apt-get --help && apt-get update && apt-get -y install curl make | ||
yum --help && (curl --help && yum -y install curl) && yum install make | ||
# This script does a bit of extra preparation of the docker containers used to run the GitHub workflows | ||
# that are specific to this project's needs when building/testing. Note that this script runs on | ||
# every supported Linux distribution so it must adapt to the distribution that it is running. | ||
|
||
(cat /etc/os-release | grep bookworm) && apt-get -y install libstdc++-12-dev gnupg2 | ||
(cat /etc/os-release | grep 'Fedora Linux 39') && yum -y install libstdc++-devel libstdc++-static | ||
# Install the basic utilities depending on the type of Linux distribution | ||
apt-get --help && apt-get update && TZ=Etc/UTC apt-get -y install curl make gpg tzdata | ||
yum --help && (curl --help && yum -y install curl) && yum install make gpg | ||
|
||
exit 0 | ||
set -e | ||
|
||
while [ $# -ne 0 ]; do | ||
arg="$1" | ||
case "$arg" in | ||
--install-swiftly) | ||
installSwiftly=true | ||
;; | ||
*) | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
if [ "$installSwiftly" == true ]; then | ||
echo "Installing swiftly" | ||
curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION}-$(uname -m).tar.gz && tar zxf swiftly-*.tar.gz && ./swiftly init -y --skip-install | ||
|
||
. "/root/.local/share/swiftly/env.sh" | ||
hash -r | ||
|
||
if [ -n "$GITHUB_ENV" ]; then | ||
echo "Updating GitHub environment" | ||
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 | ||
else | ||
echo "Installing latest toolchain" | ||
swiftly install --post-install-file=post-install.sh latest | ||
fi | ||
|
||
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 | ||
|
||
CC=clang swiftly run "$(dirname "$0")/install-libarchive.sh" | ||
else | ||
"$(dirname "$0")/install-libarchive.sh" | ||
fi |