aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.circleci/config.yml40
-rwxr-xr-x.circleci/init.sh40
-rwxr-xr-x.circleci/install_reloc.sh4
-rwxr-xr-x.circleci/install_spm.sh4
-rw-r--r--.circleci/runtime.sh15
-rwxr-xr-x.circleci/test_spm.sh3
6 files changed, 87 insertions, 19 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 270bd76..54b5d9e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,7 +1,7 @@
version: 2.1
jobs:
- build:
+ build-centos7:
docker:
- image: centos:7
@@ -29,6 +29,36 @@ jobs:
command: |
.circleci/install_reloc.sh
+ - run:
+ name: "Install spm"
+ command: |
+ .circleci/install_spm.sh
+
+ - run:
+ name: "Run tests"
+ command: |
+ .circleci/test_spm.sh
+
+ build-macos:
+ macos:
+ xcode: 11.4.0
+
+ environment:
+ HOMEBREW_NO_AUTO_UPDATE: 1
+ DYLD_INSERT_LIBRARIES: /usr/lib/libgmalloc.dylib
+
+ steps:
+ - checkout
+
+ - run:
+ name: "Initialize"
+ command: |
+ .circleci/init.sh
+
+ - run:
+ name: "Install reloc"
+ command: |
+ .circleci/install_reloc.sh
- run:
name: "Install spm"
@@ -39,3 +69,11 @@ jobs:
name: "Run tests"
command: |
.circleci/test_spm.sh
+
+workflows:
+ version: 2
+ build-and-test:
+ jobs:
+ - build-centos7
+ - build-macos
+
diff --git a/.circleci/init.sh b/.circleci/init.sh
index 81c5091..877b9de 100755
--- a/.circleci/init.sh
+++ b/.circleci/init.sh
@@ -1,16 +1,26 @@
#!/bin/bash
-yum install -y \
- make \
- patchelf \
- binutils \
- curl-devel \
- openssl-devel \
- file \
- which \
- rsync \
- tar \
- cmake3 \
- gcc \
- gcc-c++ \
- gcc-gfortran \
- glibc-devel
+if [[ $(uname -s) == Linux ]]; then
+ yum install -y \
+ make \
+ patchelf \
+ binutils \
+ curl-devel \
+ openssl-devel \
+ file \
+ which \
+ rsync \
+ tar \
+ cmake3 \
+ gcc \
+ gcc-c++ \
+ gcc-gfortran \
+ glibc-devel
+
+ ln -s cmake3 /usr/bin/cmake
+ ln -s ctest3 /usr/bin/ctest
+
+elif [[ $(uname -s) == Darwin ]]; then
+ brew install cmake \
+ gnu-tar \
+ openssl@1.1
+fi
diff --git a/.circleci/install_reloc.sh b/.circleci/install_reloc.sh
index 35945f3..cd7be7b 100755
--- a/.circleci/install_reloc.sh
+++ b/.circleci/install_reloc.sh
@@ -1,8 +1,10 @@
#!/bin/bash
+source $(dirname "${BASH_SOURCE[0]}")/runtime.sh
+
git clone https://github.com/jhunkeler/reloc
mkdir -p reloc/build
pushd reloc/build
- cmake3 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ..
+ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ..
make install
popd
rm -rf reloc
diff --git a/.circleci/install_spm.sh b/.circleci/install_spm.sh
index 4aaea1c..33960c5 100755
--- a/.circleci/install_spm.sh
+++ b/.circleci/install_spm.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+source $(dirname "${BASH_SOURCE[0]}")/runtime.sh
+
mkdir build
cd build
-cmake3 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug ..
+cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug ..
make install
diff --git a/.circleci/runtime.sh b/.circleci/runtime.sh
new file mode 100644
index 0000000..0b41b9c
--- /dev/null
+++ b/.circleci/runtime.sh
@@ -0,0 +1,15 @@
+if [[ $(uname -s) == Linux ]]; then
+ :
+elif [[ $(uname -s) == Darwin ]]; then
+ OPENSSL_DIR=/usr/local/opt/openssl
+ PATH="$OPENSSL_DIR/bin:$PATH"
+ LDFLAGS="$LDFLAGS -L${OPENSSL_DIR}/lib"
+ CFLAGS="$CFLAGS -I${OPENSSL_DIR}/include"
+
+ GTAR_DIR=/usr/local/opt/gnu-tar
+ PATH="$GTAR_DIR/libexec/gnubin:$PATH"
+
+ export PATH
+ export LDFLAGS
+ export CFLAGS
+fi
diff --git a/.circleci/test_spm.sh b/.circleci/test_spm.sh
index bb70212..f016e52 100755
--- a/.circleci/test_spm.sh
+++ b/.circleci/test_spm.sh
@@ -1,4 +1,5 @@
#!/bin/bash -e
+source $(dirname "${BASH_SOURCE[0]}")/runtime.sh
export PREFIX=/tmp/root
export SHELL=/bin/bash
@@ -6,7 +7,7 @@ cd build
set -x
-ctest3 -V
+ctest -V
spm --list