Skip to content

Commit

Permalink
Merge pull request #37 from nexB/35-update-pyenv
Browse files Browse the repository at this point in the history
Try to run test correctly on Linux AND macOS
  • Loading branch information
pombredanne authored Jun 5, 2019
2 parents 619a871 + 0aa006c commit 5d15936
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 39 deletions.
62 changes: 30 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
language: generic

env:
matrix:
- PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
- PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"


# Travis does not offer OSX with arbitrary python versions (like 2.7.13 above)
# So, you cannot simply have the following section in your build matrix:
# os:
# - linux
# - osx
# Instead, you have to include OSX entries into the build matrix manually.
# In particular, this means specifying the environment variables again.

# The following was adapted from here:
# https://docs.travis-ci.com/user/multi-os/
# Set `language: generic` to clear `language: python` from above
# Set `python:` (to empty) to clear it from the travis-ci web interface
# Set `osx_image: xcode7.3` to pin OSX version see here:
# https://docs.travis-ci.com/user/osx-ci-environment/

matrix:
include:
- os: osx
language: generic
python:
osx_image: xcode7.3
env: PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
env:
- PYENV_PYTHON="2.7.14"

- os: osx
language: generic
python:
osx_image: xcode7.3
env: PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"
env:
- PYENV_PYTHON="3.6.1"

- os: linux
language: generic
env:
- PYENV_PYTHON="2.7.14"

- os: linux
language: generic
env:
- PYENV_PYTHON="3.6.1"


install:
- |
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
rm -rf ~/.pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
exec "$SHELL"
fi
- which pyenv
- pyenv install --list
- echo $PYTHON_EXE
- python --version
- pyenv install "$PYENV_PYTHON"
- pyenv global "$PYENV_PYTHON"
- python --version
- ./configure

before_script:
- bin/about-code check --verbose .

script:
- bin/about-code check --verbose .
- "bin/py.test -vvs"


notifications:
irc:
channels:
Expand Down
7 changes: 0 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ environment:
matrix:
- PYTHON_EXE: "C:\\Python27\\python.exe"
- PYTHON_EXE: "C:\\Python27-x64\\python.exe"
- PYTHON_EXE: "C:\\Python34\\python.exe"
- PYTHON_EXE: "C:\\Python34-x64\\python.exe"
- PYTHON_EXE: "C:\\Python35\\python.exe"
- PYTHON_EXE: "C:\\Python35-x64\\python.exe"
- PYTHON_EXE: "C:\\Python36\\python.exe"
- PYTHON_EXE: "C:\\Python36-x64\\python.exe"

Expand All @@ -21,8 +17,5 @@ test_script:
- 'bin\python -c "from __future__ import print_function;import sys;print(sys.getdefaultencoding())"'
- 'bin\py.test -vvs'

on_success:
- "python etc/scripts/irc-notify.py aboutcode [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_green}Succeeded,Details: {build_url},Commit: {commit_url}"

on_failure:
- "python etc/scripts/irc-notify.py aboutcode [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_red}Failed,Details: {build_url},Commit: {commit_url}"
63 changes: 63 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
trigger:
branches:
include: ['pipeline']
tags:
include: ['*']

jobs:
- job: tests
displayName: Run tests
steps:
- script: ./configure
- script: ./bin/py.test -vvs tests/commoncode

jobs:
- job: Tests

strategy:

matrix:
Python_27_Linux:
imageName: 'ubuntu-16.04'
python.version: '2.7'
Python_27_Mac:
imageName: 'macos-10.13'
python.version: '2.7'
Python_27_Win:
imageName: 'vs2017-win2016'
python.version: '2.7'

Python_36_Linux:
imageName: 'ubuntu-16.04'
python.version: '3.6'
Python_36_Mac:
imageName: 'macos-10.13'
python.version: '3.6'
Python_36_Windows:
imageName: 'vs2017-win2016'
python.version: '3.6'

Python_37_Linux:
imageName: 'ubuntu-16.04'
python.version: '3.7'
Python_37_Mac:
imageName: 'macos-10.13'
python.version: '3.7'
Python_37_Windows:
imageName: 'vs2017-win2016'
python.version: '3.7'

pool:
vmImage: $(imageName)

steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
configure
bin/py.test -vvs
displayName: 'Run tests'

0 comments on commit 5d15936

Please sign in to comment.