blob: 2a417766596a4b28216993ba27e83f05b14b79b4 [file] [log] [blame]
Petr Michalec79047742018-05-09 22:04:27 +02001sudo: required
2language: python
3dist: trusty
4cache: pip
5python:
6- '2.7'
7- '3.6'
8service:
9- docker
10
11#apt:
12 #update: true
13
14#stages:
15#- name: test
16#- name: coverage
17#- name: models
18#- name: build
19# if: fork = false
20#- name: publish
21# if: tag =~ ^v.* and fork = false and branch = 'master'
22
23env:
24 global:
25 - PACKAGENAME="reclass"
26
27install: &pyinst
28- pip install pyparsing
29- pip install PyYAML
30# To test example models with kitchen:
31- |
32 test -e Gemfile || cat <<EOF > Gemfile
33 source 'https://rubygems.org'
34 gem 'rake'
35 gem 'test-kitchen'
36 gem 'kitchen-docker'
37 gem 'kitchen-inspec'
38 gem 'inspec'
39- bundle install
40
41script:
42- python setup.py install
43- find . reclass -name 'test_*.py' | sort | xargs -n1 -i% bash -c "echo %; python %"
44# To test example models with kitchen:
45- export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
46- kitchen list
47- if [ "$PYTHON_VERSION" = "2.7" ]; then kitchen test; fi
48
49# NOTE: travis stage builds, below saved for future reference
50#jobs:
51# include:
52# - stage: test
53# script: &unittest
54# - python setup.py install
55# - find . reclass -name 'test_*.py' | sort | xargs -n1 -i% bash -c "echo %; python %"
56#
57# - stage: coverage
58# install: *pyinst
59# script:
60# - python3 -m pytest --cov=. --cov-report=term-missing:skip-covered
61# - coverage xml
62# #- coveralls
63# #- |
64# #[ ! -z "${CODACY_PROJECT_TOKEN}" ] && python-codacy-coverage -r coverage.xml || echo "Codacy coverage NOT exported"
65#
66# - stage: lint
67# script:
68# - python3 -m flake8
69#
70# - stage: models
71# install: &kitchen
72# - pip install PyYAML
73# - pip install virtualenv
74# - |
75# test -e Gemfile || cat <<EOF > Gemfile
76# source 'https://rubygems.org'
77# gem 'rake'
78# gem 'test-kitchen'
79# gem 'kitchen-docker'
80# gem 'kitchen-inspec'
81# gem 'inspec'
82# - bundle install
83# script:
84# - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
85# - kitchen list
86# #FIXME- kitchen test
87#
88# - stage: build
89# install: *pyinst
90# script: []
91#
92# - stage: publish
93# install:
94# - "/bin/true"
95# script:
96# - "/bin/true"
97# deploy:
98# provider: pypi
99# user: epcim
100# password:
101# secure: TBD
102# on:
103# tags: true
104# repo: salt-formulas/reclass
105# branch: master
106# #FIXME, $TRAVIS_PYTHON_VERSION == '2.7'
107
108notifications:
109 webhooks:
110 on_success: change # options: [always|never|change] default: always
111 on_failure: never
112 on_start: never
113 on_cancel: never
114 on_error: never
115 email: true
116