feat: convert `template-formula` to `arvados-formula`
[arvados-formula.git] / .travis.yml
1 # -*- coding: utf-8 -*-
2 # vim: ft=yaml
3 ---
4 ## Machine config
5 os: 'linux'
6 arch: 'amd64'
7 dist: 'bionic'
8 version: '~> 1.0'
9
10 ## Language and cache config
11 language: 'ruby'
12 cache: 'bundler'
13
14 ## Services config
15 services:
16   - docker
17
18 ## Script to run for the test stage
19 script:
20   - bin/kitchen verify "${INSTANCE}"
21
22 ## Stages and jobs matrix
23 stages:
24   - test
25   - name: 'release'
26     if: 'branch = master AND type != pull_request'
27 jobs:
28   include:
29     ## Define the test stage that runs the linters (and testing matrix, if applicable)
30
31     # Run all of the linters in a single job
32     - language: 'node_js'
33       node_js: 'lts/*'
34       env: 'Lint'
35       name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
36       before_install: 'skip'
37       script:
38         # Install and run `salt-lint`
39         - pip install --user salt-lint
40         - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
41                         | xargs salt-lint
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
45         - yamllint -s .
46         # Install and run `rubocop`
47         - gem install rubocop
48         - rubocop -d
49         # Run `shellcheck` (already pre-installed in Travis)
50         - shellcheck --version
51         - git ls-files -- '*.sh' '*.bash' '*.ksh'
52                         | xargs shellcheck
53         # Install and run `commitlint`
54         - npm i -D @commitlint/config-conventional
55                    @commitlint/travis-cli
56         - commitlint-travis
57
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
108
109     ## Define the release stage that runs `semantic-release`
110     - stage: 'release'
111       language: 'node_js'
112       node_js: 'lts/*'
113       env: 'Release'
114       name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
115       before_install: 'skip'
116       script:
117         # Update `AUTHORS.md`
118         - export MAINTAINER_TOKEN=${GH_TOKEN}
119         - go get github.com/myii/maintainer
120         - maintainer contributor
121
122         # Install all dependencies required for `semantic-release`
123         - npm i -D @semantic-release/changelog@3
124                    @semantic-release/exec@3
125                    @semantic-release/git@7
126       deploy:
127         provider: 'script'
128         # Opt-in to `dpl v2` to complete the Travis build config validation (beta)
129         # * https://docs.travis-ci.com/user/build-config-validation
130         # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
131         edge: true
132         # Run `semantic-release`
133         script: 'npx semantic-release@15.14'