Skip to content

Commit cf4e15a

Browse files
Setup Amazon Linux CI
1 parent 646cf16 commit cf4e15a

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

.github/workflows/amazonlinux.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build toolchain for Amazon Linux
2+
3+
on:
4+
push:
5+
branches:
6+
- swiftwasm
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
amazonlinux2_build:
11+
timeout-minutes: 0
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: Free disk space
15+
run: |
16+
df -h
17+
sudo swapoff -a
18+
sudo rm -f /swapfile
19+
sudo rm -rf /opt/hostedtoolcache
20+
sudo rm -rf /usr/share/dotnet
21+
sudo apt clean
22+
docker rmi $(docker image ls -aq)
23+
df -h
24+
- uses: actions/checkout@v2
25+
- run: |
26+
SWIFT_IMAGE=swiftwasm:nightly-$GITHUB_SHA
27+
docker build --build-arg SWIFT_GIT_SHA=$GITHUB_SHA \
28+
--tag $SWIFT_IMAGE ./utils/webassembly/amazonlinux
29+
docker run -v $GITHUB_WORKSPACE:/home/host-dir $SWIFT_IMAGE \
30+
cp -r /home/ec2-user/swift-wasm-DEVELOPMENT-SNAPSHOT-amazonlinux2_x86_64.tar.gz /home/host-dir
31+
32+
- name: Upload Ubuntu 20.04 installable archive
33+
uses: actions/upload-artifact@v1
34+
with:
35+
name: amazonlinux2-installable
36+
path: swift-wasm-DEVELOPMENT-SNAPSHOT-amazonlinux2_x86_64.tar.gz
37+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM amazonlinux:2
2+
3+
WORKDIR /home/ec2-user
4+
5+
# The build needs a package from the EPEL repo so that needs to be enabled.
6+
# https://www.tecmint.com/install-epel-repository-on-centos/
7+
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
8+
9+
# Update and install needed build packages
10+
RUN yum -y update
11+
RUN yum -y group install "development tools"
12+
RUN yum -y install \
13+
git cmake clang python swig uuid-devel libicu-devel libedit-devel \
14+
libxml2-devel sqlite-devel ncurses-devel pkgconfig python-devel \
15+
python-pkgconfig libbsd-devel libuuid-devel pexpect curl-devel \
16+
tzdata rsync wget which python-six ninja-build
17+
RUN ln -s /usr/bin/ninja-build /usr/bin/ninja
18+
19+
# Install sccache
20+
RUN mkdir /opt/sccache && cd /opt/sccache && \
21+
wget -O - "https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz" | \
22+
tar xz --strip-components 1 && \
23+
ln -sf /opt/sccache/sccache /usr/local/bin
24+
25+
# Grab an updated version of cmake
26+
RUN wget https://cmake.org/files/v3.16/cmake-3.16.5-Linux-x86_64.tar.gz \
27+
&& tar xvzf cmake-3.16.5-Linux-x86_64.tar.gz \
28+
&& rm cmake-3.16.5-Linux-x86_64.tar.gz
29+
30+
# Add updated version of cmake to path
31+
ENV PATH="/home/ec2-user/cmake-3.16.5-Linux-x86_64/bin/:${PATH}"
32+
33+
34+
# Bootstrap the swift source and do a full checkout
35+
ARG SWIFT_GIT_SHA
36+
RUN git clone https://github.com/swiftwasm/swift.git
37+
WORKDIR /home/ec2-user/swift
38+
RUN git checkout $SWIFT_GIT_SHA
39+
RUN ./utils/update-checkout --clone --scheme wasm --skip-repository swift
40+
RUN ./utils/webassembly/install-wasi-sdk.sh linux ubuntu-18.04
41+
42+
RUN ./utils/webassembly/build-toolchain.sh

0 commit comments

Comments
 (0)