Skip to content

Commit db2445a

Browse files
authored
Improve Ubuntu 22.04 compatibility (#10)
1 parent adcaf4b commit db2445a

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

.github/workflows/CI.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,36 @@ on:
1111
- '!.github/workflows/CI.yaml'
1212

1313
jobs:
14+
test-setup:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
image:
19+
- ubuntu:18.04
20+
- ubuntu:20.04
21+
- ubuntu:22.04
22+
- centos:7
23+
- amazonlinux:2
24+
fail-fast: false
25+
container:
26+
image: ${{ matrix.image }}
27+
steps:
28+
- name: Install dependencies
29+
if: ${{ startsWith(matrix.image, 'amazonlinux:') }}
30+
run: yum install gzip tar -y
31+
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
35+
- name: Set up environment
36+
if: ${{ startsWith(matrix.image, 'ubuntu:') }}
37+
run: |
38+
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
39+
echo "DEBCONF_NONINTERACTIVE_SEEN=true" >> $GITHUB_ENV
40+
41+
- name: Test swiftbox setup
42+
run: ./swiftbox.sh list
43+
1444
test-ubuntu:
1545
runs-on: ubuntu-20.04
1646
env:

swiftbox.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Set environment properties
44

5-
SWIFTBOX_VERSION="0.13.2"
5+
SWIFTBOX_VERSION="0.13.3"
66
SWIFT_DOWNLOAD_SITE="https://download.swift.org"
77

88
if [ `id -u` = 0 ]
@@ -127,18 +127,33 @@ init-env() {
127127
case $SYSTEM_NAME in
128128
ubuntu)
129129
$SUDO_FLAG apt-get update
130-
$SUDO_FLAG apt-get install gnupg git libpython2.7 binutils tzdata libxml2 clang libicu-dev pkg-config zlib1g-dev libedit2 libsqlite3-0 libz3-dev -y
130+
case $SYSTEM_VERSION in
131+
16.04 | 18.04 | 20.04 | 22.04) ;;
132+
*)
133+
echo "It seems you're using an unsupported Ubuntu version. Dependency installation might fail."
134+
;;
135+
esac
136+
COMMON_DEPS="binutils git gnupg2 libc6-dev libedit2 libsqlite3-0 pkg-config tzdata zlib1g-dev"
131137
case $SYSTEM_VERSION in
132138
16.04 | 18.04)
133-
$SUDO_FLAG apt-get install libgcc-5-dev libstdc++-5-dev -y
139+
FOUNDATION_DEPS="libcurl4 libxml2 libicu-dev"
140+
GCC_DEPS="libgcc-5-dev libstdc++-5-dev"
141+
PYTHON_DEP="libpython2.7"
134142
;;
135143
20.04)
136-
$SUDO_FLAG apt-get install libgcc-9-dev libstdc++-9-dev -y
144+
FOUNDATION_DEPS="libcurl4 libxml2"
145+
GCC_DEPS="libgcc-9-dev libstdc++-9-dev"
146+
PYTHON_DEP="libpython2.7"
147+
OTHER_DEPS="uuid-dev"
137148
;;
138-
*)
139-
echo "You should install the corresponding version of libgcc-dev and libstdc++-dev manually to enable full functionalities of Swift."
149+
22.04 | *)
150+
FOUNDATION_DEPS="libcurl4-openssl-dev libxml2-dev"
151+
GCC_DEPS="libgcc-9-dev libstdc++-9-dev"
152+
PYTHON_DEP="libpython3.8"
153+
OTHER_DEPS="unzip"
140154
;;
141155
esac
156+
$SUDO_FLAG apt-get install $COMMON_DEPS $FOUNDATION_DEPS $GCC_DEPS $PYTHON_DEP $OTHER_DEPS -y
142157
;;
143158
centos)
144159
$SUDO_FLAG yum install binutils gcc git libedit libicu-devel pkg-config python2 sqlite zlib-devel -y
@@ -154,7 +169,7 @@ init-env() {
154169
esac
155170
;;
156171
amazonlinux)
157-
$SUDO_FLAG yum install binutils gcc git glibc-static gzip libbsd libcurl libedit libicu sqlite libstdc++-static libuuid libxml2 tar -y
172+
$SUDO_FLAG yum install binutils gcc git glibc-static gzip libbsd libcurl libedit libicu sqlite libstdc++-static libuuid libxml2 tar tzdata -y
158173
;;
159174
esac
160175
wget -q -O - https://swift.org/keys/all-keys.asc | $SUDO_FLAG gpg --import -

0 commit comments

Comments
 (0)