File tree 3 files changed +42
-8
lines changed
3 files changed +42
-8
lines changed Original file line number Diff line number Diff line change 6
6
strategy :
7
7
matrix :
8
8
os : [macOS-10.15, Ubuntu-18.04]
9
- include :
10
- - os : macOS-10.15
11
- toolchain : https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.3-SNAPSHOT-2020-08-10-a/swift-wasm-5.3-SNAPSHOT-2020-08-10-a-osx.tar.gz
12
- - os : Ubuntu-18.04
13
- toolchain : https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.3-SNAPSHOT-2020-08-10-a/swift-wasm-5.3-SNAPSHOT-2020-08-10-a-linux.tar.gz
14
9
runs-on : ${{ matrix.os }}
15
10
steps :
16
11
- name : Checkout
23
18
export SWIFTENV_ROOT="$HOME/.swiftenv"
24
19
export PATH="$SWIFTENV_ROOT/bin:$PATH"
25
20
eval "$(swiftenv init -)"
26
- swiftenv install $TOOLCHAIN_DOWNLOAD
27
21
make bootstrap
28
22
make test
29
- env :
30
- TOOLCHAIN_DOWNLOAD : ${{ matrix.toolchain }}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
2
2
3
3
.PHONY : bootstrap
4
4
bootstrap :
5
+ ./scripts/install-toolchain.sh
5
6
npm install
6
7
7
8
.PHONY : build
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eu
3
+
4
+ scripts_dir=" $( cd " $( dirname $0 ) " && pwd) "
5
+
6
+ swift_version=" $( cat $scripts_dir /../.swift-version) "
7
+ swift_tag=" swift-$swift_version "
8
+
9
+ if [ -z " $( which swiftenv) " ]; then
10
+ echo " swiftenv not installed, please install it before this script."
11
+ exit 1
12
+ fi
13
+
14
+ if [ ! -z " $( swiftenv versions | grep $swift_version ) " ]; then
15
+ echo " $swift_version is already installed."
16
+ exit 0
17
+ fi
18
+
19
+ case $( uname -s) in
20
+ Darwin)
21
+ toolchain_download=" $swift_tag -osx.tar.gz"
22
+ ;;
23
+ Linux)
24
+ if [ $( grep RELEASE /etc/lsb-release) == " DISTRIB_RELEASE=18.04" ]; then
25
+ toolchain_download=" $swift_tag -ubuntu18.04.tar.gz"
26
+ elif [ $( grep RELEASE /etc/lsb-release) == " DISTRIB_RELEASE=20.04" ]; then
27
+ toolchain_download=" $swift_tag -ubuntu20.04.tar.gz"
28
+ else
29
+ echo " Unknown Ubuntu version"
30
+ exit 1
31
+ fi
32
+ ;;
33
+ * )
34
+ echo " Unrecognised platform $( uname -s) "
35
+ exit 1
36
+ ;;
37
+ esac
38
+
39
+ toolchain_download_url=" https://github.com/swiftwasm/swift/releases/download/$swift_tag /$toolchain_download "
40
+
41
+ swiftenv install " $toolchain_download_url "
You can’t perform that action at this time.
0 commit comments