blob: b060639f856198dc3b3a8832a234e52d087ff878 [file] [log] [blame]
sudo: required
language: python
dist: trusty
cache: pip
python:
- '2.7'
- '3.6'
service:
- docker
#apt:
#update: true
#stages:
#- name: test
#- name: coverage
#- name: models
#- name: build
# if: fork = false
#- name: publish
# if: tag =~ ^v.* and fork = false and branch = 'master'
env:
global:
- PACKAGENAME="reclass"
install: &pyinst
- pip install pyparsing
- pip install PyYAML
# To test example models with kitchen:
- |
test -e Gemfile || cat <<EOF > Gemfile
source 'https://rubygems.org'
gem 'rake'
gem 'test-kitchen'
gem 'kitchen-docker'
gem 'kitchen-inspec'
gem 'inspec'
- bundle install
script:
- python setup.py install
- find . reclass -name 'test_*.py' | sort | xargs -n1 -i% bash -c "echo %; python %"
# To test example models with kitchen:
- export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
- kitchen list
- kitchen test
# NOTE: travis stage builds, below saved for future reference
#jobs:
# include:
# - stage: test
# script: &unittest
# - python setup.py install
# - find . reclass -name 'test_*.py' | sort | xargs -n1 -i% bash -c "echo %; python %"
#
# - stage: coverage
# install: *pyinst
# script:
# - python3 -m pytest --cov=. --cov-report=term-missing:skip-covered
# - coverage xml
# #- coveralls
# #- |
# #[ ! -z "${CODACY_PROJECT_TOKEN}" ] && python-codacy-coverage -r coverage.xml || echo "Codacy coverage NOT exported"
#
# - stage: lint
# script:
# - python3 -m flake8
#
# - stage: models
# install: &kitchen
# - pip install PyYAML
# - pip install virtualenv
# - |
# test -e Gemfile || cat <<EOF > Gemfile
# source 'https://rubygems.org'
# gem 'rake'
# gem 'test-kitchen'
# gem 'kitchen-docker'
# gem 'kitchen-inspec'
# gem 'inspec'
# - bundle install
# script:
# - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
# - kitchen list
# #FIXME- kitchen test
#
# - stage: build
# install: *pyinst
# script: []
#
# - stage: publish
# install:
# - "/bin/true"
# script:
# - "/bin/true"
# deploy:
# provider: pypi
# user: epcim
# password:
# secure: TBD
# on:
# tags: true
# repo: salt-formulas/reclass
# branch: master
# #FIXME, $TRAVIS_PYTHON_VERSION == '2.7'
notifications:
webhooks:
on_success: change # options: [always|never|change] default: always
on_failure: never
on_start: never
on_cancel: never
on_error: never
email: true