blob: 559ef9ae153135d9007685e43fea491b97c52753 [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
Alexey Ovchinnikovaeea6882018-07-19 16:03:34 +040028- pip install -r requirements.txt
29#- pip install pyparsing
30#- pip install PyYAML
Petr Michalec79047742018-05-09 22:04:27 +020031# To test example models with kitchen:
32- |
33 test -e Gemfile || cat <<EOF > Gemfile
34 source 'https://rubygems.org'
35 gem 'rake'
36 gem 'test-kitchen'
37 gem 'kitchen-docker'
38 gem 'kitchen-inspec'
39 gem 'inspec'
40- bundle install
41
42script:
43- python setup.py install
44- find . reclass -name 'test_*.py' | sort | xargs -n1 -i% bash -c "echo %; python %"
45# To test example models with kitchen:
46- export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
47- kitchen list
Petr Michalec2e012232018-06-18 09:42:40 +020048- kitchen test
Petr Michalec79047742018-05-09 22:04:27 +020049
50# NOTE: travis stage builds, below saved for future reference
51#jobs:
52# include:
53# - stage: test
54# script: &unittest
55# - python setup.py install
56# - find . reclass -name 'test_*.py' | sort | xargs -n1 -i% bash -c "echo %; python %"
57#
58# - stage: coverage
59# install: *pyinst
60# script:
61# - python3 -m pytest --cov=. --cov-report=term-missing:skip-covered
62# - coverage xml
63# #- coveralls
64# #- |
65# #[ ! -z "${CODACY_PROJECT_TOKEN}" ] && python-codacy-coverage -r coverage.xml || echo "Codacy coverage NOT exported"
66#
67# - stage: lint
68# script:
69# - python3 -m flake8
70#
71# - stage: models
72# install: &kitchen
73# - pip install PyYAML
74# - pip install virtualenv
75# - |
76# test -e Gemfile || cat <<EOF > Gemfile
77# source 'https://rubygems.org'
78# gem 'rake'
79# gem 'test-kitchen'
80# gem 'kitchen-docker'
81# gem 'kitchen-inspec'
82# gem 'inspec'
83# - bundle install
84# script:
85# - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
86# - kitchen list
87# #FIXME- kitchen test
88#
89# - stage: build
90# install: *pyinst
91# script: []
92#
93# - stage: publish
94# install:
95# - "/bin/true"
96# script:
97# - "/bin/true"
98# deploy:
99# provider: pypi
100# user: epcim
101# password:
102# secure: TBD
103# on:
104# tags: true
105# repo: salt-formulas/reclass
106# branch: master
107# #FIXME, $TRAVIS_PYTHON_VERSION == '2.7'
108
109notifications:
110 webhooks:
111 on_success: change # options: [always|never|change] default: always
112 on_failure: never
113 on_start: never
114 on_cancel: never
115 on_error: never
116 email: true
117