Skip to content

Commit 7018e58

Browse files
jborean93frozencemetery
authored andcommitted
Added MacOS to Travis-CI build tests
1 parent 1cb15b5 commit 7018e58

File tree

2 files changed

+51
-15
lines changed

2 files changed

+51
-15
lines changed

.travis.yml

+40-15
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ language: python
66
services:
77
- docker
88

9-
env:
10-
- DISTRO=debian:stable PYTHON="2"
11-
- DISTRO=debian:stable PYTHON="3" # 3.4, not 3.5
12-
- DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal"
13-
- DISTRO=centos:7 PYTHON="2" # el7 doesn't do python3 modules
14-
- DISTRO=fedora:rawhide PYTHON="3"
15-
- DISTRO=fedora:rawhide PYTHON="2"
16-
17-
# we do everything in docker
9+
# we do everything in docker for non MacOS, MacOS setup is in .travis/build.sh
1810
install: skip
1911
before_install: skip
2012

@@ -27,10 +19,11 @@ stages:
2719
if: tag is PRESENT
2820

2921
script:
30-
- sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts
31-
- sudo hostname test.box
32-
- source ./.travis/lib-util.sh
33-
- util::docker-run $DISTRO ./.travis/build.sh
22+
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts; fi
23+
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo hostname test.box; fi
24+
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then source ./.travis/lib-util.sh; fi
25+
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then util::docker-run $DISTRO ./.travis/build.sh; fi
26+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.travis/build.sh; fi
3427

3528
jobs:
3629
include:
@@ -46,6 +39,39 @@ jobs:
4639
- source ./.travis/lib-util.sh
4740
- util::docker-run $DISTRO ./.travis/verify.sh
4841

42+
43+
# need to explictly define each builder for test due to different os types
44+
- stage: test
45+
env: DISTRO=debian:stable PYTHON="2"
46+
47+
- stage: test
48+
env: DISTRO=debian:stable PYTHON="3" # 3.4, not 3.5
49+
50+
- stage: test
51+
env: DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal"
52+
53+
- stage: test
54+
env: DISTRO=centos:7 PYTHON="2" # el7 doesn't do python3 modules
55+
56+
- stage: test
57+
env: DISTRO=fedora:rawhide PYTHON="3"
58+
59+
- stage: test
60+
env: DISTRO=fedora:rawhide PYTHON="2"
61+
62+
- stage: test
63+
env: PYTHON="2" KRB5_VER="heimdal" PYENV="2.7.14"
64+
os: osx
65+
osx_image: xcode9.2
66+
language: generic # causes issues with pyenv installer when set to python
67+
68+
- stage: test
69+
env: PYTHON="3" KRB5_VER="heimdal" PYENV="3.6.3"
70+
os: osx
71+
osx_image: xcode9.2
72+
language: generic # causes issues with pyenv installer when set to python
73+
74+
4975
- stage: deploy latest docs
5076
script: skip
5177
env:
@@ -97,10 +123,9 @@ jobs:
97123
all_branches: true
98124
# NB(directxman12): this is a hack. Check ./.travis/before-deploy.sh for an explanation.
99125
distributions: "check"
100-
126+
101127
- provider: script
102128
script: .travis/docs-deploy.sh travis_docs_build/html stable pythongssapi/python-gssapi
103129
skip_cleanup: true
104130
on:
105131
all_branches: true
106-

.travis/lib-setup.sh

+11
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,22 @@ setup::rh::install() {
6464
fi
6565
}
6666

67+
setup::macos::install() {
68+
# install Python from pyenv so we know what version is being used
69+
pyenv install $PYENV
70+
pyenv global $PYENV
71+
virtualenv -p $(pyenv which python) .venv
72+
source ./.venv/bin/activate
73+
pip install --install-option='--no-cython-compile' cython
74+
}
75+
6776
setup::install() {
6877
if [ -f /etc/debian_version ]; then
6978
setup::debian::install
7079
elif [ -f /etc/redhat-release ]; then
7180
setup::rh::install
81+
elif [ "$(uname)" == "Darwin" ]; then
82+
setup::macos::install
7283
else
7384
echo "Distro not found!"
7485
false

0 commit comments

Comments
 (0)