1 # -*- coding: utf-8 -*-
10 ## Language and cache config
18 ## Script to run for the test stage
20 - bin/kitchen verify "${INSTANCE}"
22 ## Stages and jobs matrix
26 if: 'branch = master AND type != pull_request'
29 ## Define the test stage that runs the linters (and testing matrix, if applicable)
31 # Run all of the linters in a single job
35 name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
36 before_install: 'skip'
38 # Install and run `salt-lint`
39 - pip install --user salt-lint
40 - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
42 # Install and run `yamllint`
43 # Need at least `v1.17.0` for the `yaml-files` setting
44 - pip install --user yamllint>=1.17.0
46 # Install and run `rubocop`
49 # Run `shellcheck` (already pre-installed in Travis)
50 - shellcheck --version
51 - git ls-files -- '*.sh' '*.bash' '*.ksh'
53 # Install and run `commitlint`
54 - npm i -D @commitlint/config-conventional
55 @commitlint/travis-cli
58 ## Define the rest of the matrix based on Kitchen testing
59 # Make sure the instances listed below match up with
60 # the `platforms` defined in `kitchen.yml`
61 # NOTE: Please try to select up to six instances that add some meaningful
62 # testing of the formula's behaviour. If possible, try to refrain from
63 # the classical "chosing all the instances because I want to test on
64 # another/all distro/s" trap: it will just add time to the testing (see
65 # the discussion on #121). As an example, the set chosen below covers
66 # the most used distros families, systemd and non-systemd and the latest
67 # three supported Saltstack versions with python2 and 3.
68 # As for `kitchen.yml`, that should still contain all of the platforms,
69 # to allow for comprehensive local testing
70 # Ref: https://github.com/saltstack-formulas/template-formula/issues/118
71 # Ref: https://github.com/saltstack-formulas/template-formula/issues/121
72 - env: INSTANCE=default-debian-10-master-py3
73 # - env: INSTANCE=default-ubuntu-1804-master-py3
74 - env: INSTANCE=default-centos-8-master-py3
75 # - env: INSTANCE=default-fedora-31-master-py3
76 # - env: INSTANCE=default-opensuse-leap-151-master-py3
77 # - env: INSTANCE=default-amazonlinux-2-master-py3
78 # - env: INSTANCE=default-arch-base-latest-master-py2
79 # - env: INSTANCE=default-debian-10-3000-1-py3
80 - env: INSTANCE=default-ubuntu-1804-3000-1-py3
81 # - env: INSTANCE=default-centos-8-3000-1-py3
82 # - env: INSTANCE=default-fedora-31-3000-1-py3
83 - env: INSTANCE=default-opensuse-leap-151-3000-1-py3
84 - env: INSTANCE=default-amazonlinux-2-3000-1-py3
85 # - env: INSTANCE=default-arch-base-latest-3000-1-py2
86 # - env: INSTANCE=default-debian-10-2019-2-py3
87 # - env: INSTANCE=default-debian-9-2019-2-py3
88 # - env: INSTANCE=default-ubuntu-1804-2019-2-py3
89 # - env: INSTANCE=default-ubuntu-1604-2019-2-py3
90 # - env: INSTANCE=default-centos-8-2019-2-py3
91 # - env: INSTANCE=default-centos-7-2019-2-py3
92 - env: INSTANCE=default-fedora-31-2019-2-py3
93 # - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
94 # - env: INSTANCE=default-amazonlinux-2-2019-2-py3
95 # - env: INSTANCE=default-ubuntu-1804-2019-2-py2
96 # - env: INSTANCE=default-amazonlinux-1-2019-2-py2
97 - env: INSTANCE=default-arch-base-latest-2019-2-py2
98 # - env: INSTANCE=default-centos-7-2018-3-py3
99 # - env: INSTANCE=default-fedora-30-2018-3-py3
100 # - env: INSTANCE=default-debian-9-2018-3-py2
101 # - env: INSTANCE=default-debian-8-2018-3-py2
102 # - env: INSTANCE=default-ubuntu-1804-2018-3-py2
103 # - env: INSTANCE=default-ubuntu-1604-2018-3-py2
104 - env: INSTANCE=centos6-centos-6-2018-3-py2
105 # - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
106 # - env: INSTANCE=default-amazonlinux-1-2018-3-py2
107 # - env: INSTANCE=default-arch-base-latest-2018-3-py2
110 # Test the conversion of `template-formula` into another formula
111 # ready for development
113 name: 'Test: bin/convert-formula.sh'
115 - git clone . tmp/converted-formula
116 - cd tmp/converted-formula
117 - DEBUG=true bin/convert-formula.sh converted
118 - '[ $(git rev-list HEAD --count) -eq 2 ]'
119 - bin/kitchen verify default-debian-10-2019-2-py3
122 ## Define the release stage that runs `semantic-release`
127 name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
128 before_install: 'skip'
130 # Update `AUTHORS.md`
131 - export MAINTAINER_TOKEN=${GH_TOKEN}
132 - go get github.com/myii/maintainer
133 - maintainer contributor
135 # Install all dependencies required for `semantic-release`
136 - npm i -D @semantic-release/changelog@3
137 @semantic-release/exec@3
138 @semantic-release/git@7
141 # Opt-in to `dpl v2` to complete the Travis build config validation (beta)
142 # * https://docs.travis-ci.com/user/build-config-validation
143 # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
145 # Run `semantic-release`
146 script: 'npx semantic-release@15.14'