diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-04-19 22:50:56 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-04-20 00:21:04 -0400 |
commit | cc29912fcbde997ef710a34fe3d52bb17bd67462 (patch) | |
tree | 4a3b05f4ad8303bf0f4744cf02f215a9732b24d9 | |
parent | 4cd31e08440e438c3dfd1f224babdc627d591530 (diff) | |
download | spmc-cc29912fcbde997ef710a34fe3d52bb17bd67462.tar.gz |
Add macos
-rw-r--r-- | .circleci/config.yml | 40 | ||||
-rwxr-xr-x | .circleci/init.sh | 40 | ||||
-rwxr-xr-x | .circleci/install_reloc.sh | 4 | ||||
-rwxr-xr-x | .circleci/install_spm.sh | 4 | ||||
-rw-r--r-- | .circleci/runtime.sh | 15 | ||||
-rwxr-xr-x | .circleci/test_spm.sh | 3 |
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 |