aboutsummaryrefslogtreecommitdiff
path: root/.circleci
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2020-04-20 01:56:17 -0400
committerGitHub <noreply@github.com>2020-04-20 01:56:17 -0400
commit110489259c0696c0cee5bec6ad7695a0c93d4e74 (patch)
tree34a82b9e686c15e2acb00d62a0f8b95ac126de6d /.circleci
parent57c9489b28a481abc078ad3a2dd197079f9c414b (diff)
parent667574b2e5628976c0cc0ddc2e1ae25bf5c0fd02 (diff)
downloadspmc-110489259c0696c0cee5bec6ad7695a0c93d4e74.tar.gz
Merge pull request #28 from jhunkeler/circleci-macos
Circleci macos
Diffstat (limited to '.circleci')
-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.sh33
6 files changed, 103 insertions, 33 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..eb141e5 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,31 +7,33 @@ cd build
set -x
-ctest3 -V
+ctest -V
spm --list
spm --search zlib
-spm --verbose --yes --root $PREFIX --install python
+if [[ $(uname -s) == Linux ]]; then
+ spm --verbose --yes --root $PREFIX --install python
-set +x
-echo ACTIVATING ROOT: $PREFIX
-spm --cmd mkruntime $PREFIX > $PREFIX/bin/activate || exit 1
-source $PREFIX/bin/activate || exit 1
-echo OK!
-set -x
+ set +x
+ echo ACTIVATING ROOT: $PREFIX
+ spm --cmd mkruntime $PREFIX > $PREFIX/bin/activate || exit 1
+ source $PREFIX/bin/activate || exit 1
+ echo OK!
+ set -x
-which python3
+ which python3
-python3 -V
+ python3 -V
-python3 -c 'from sysconfig import get_config_vars; from pprint import pprint; pprint(get_config_vars())'
+ python3 -c 'from sysconfig import get_config_vars; from pprint import pprint; pprint(get_config_vars())'
-python3 -m ensurepip
+ python3 -m ensurepip
-pip3 --version
+ pip3 --version
-pip3 install --upgrade pip setuptools
+ pip3 install --upgrade pip setuptools
-pip3 --version
+ pip3 --version
+fi