|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 | # vim: ft=yaml
|
3 | 3 | ---
|
4 |
| -dist: bionic |
5 |
| -stages: |
6 |
| - - test |
7 |
| - - lint |
8 |
| - - name: release |
9 |
| - if: branch = master AND type != pull_request |
| 4 | +## Machine config |
| 5 | +os: 'linux' |
| 6 | +arch: 'amd64' |
| 7 | +dist: 'bionic' |
| 8 | +version: '~> 1.0' |
10 | 9 |
|
11 |
| -sudo: required |
12 |
| -cache: bundler |
13 |
| -language: ruby |
| 10 | +## Language and cache config |
| 11 | +language: 'ruby' |
| 12 | +cache: 'bundler' |
14 | 13 |
|
| 14 | +## Services config |
15 | 15 | services:
|
16 | 16 | - docker
|
17 | 17 |
|
18 |
| -# Make sure the instances listed below match up with |
19 |
| -# the `platforms` defined in `kitchen.yml` |
20 |
| -env: |
21 |
| - matrix: |
22 |
| - # The ordering used below has been selected based on the time required in Travis |
23 |
| - # The slower ones are kept as high up as possible, to run concurrently rather than |
24 |
| - # slow down the entire run at the end (i.e. `centos-6` and `opensuse`) |
25 |
| - # However, the groupings needed to be maintained in some semblance of order |
26 |
| - # so this is a best-effort matrix, in the circumstances |
27 |
| - # - INSTANCE: v201707-py2-debian-8-2017-7-py2 |
28 |
| - - INSTANCE: v201707-py2-ubuntu-1604-2017-7-py2 |
29 |
| - - INSTANCE: v201707-py2-centos-6-2017-7-py2 |
30 |
| - # - INSTANCE: v201707-py2-amazonlinux-2-2017-7-py2 |
31 |
| - # - INSTANCE: v201803-py2-debian-9-2018-3-py2 |
32 |
| - # - INSTANCE: v201803-py2-ubuntu-1604-2018-3-py2 |
33 |
| - - INSTANCE: v201803-py2-centos-7-2018-3-py2 |
34 |
| - - INSTANCE: v201803-py2-amazonlinux-2-2018-3-py2 |
35 |
| - - INSTANCE: v201902-py2-debian-9-2019-2-py2 |
36 |
| - - INSTANCE: v201902-py2-ubuntu-1804-2019-2-py2 |
37 |
| - # - INSTANCE: v201902-py2-centos-7-2019-2-py2 |
38 |
| - # - INSTANCE: v201902-py2-opensuse-leap-15-2019-2-py2 |
39 |
| - # - INSTANCE: v201902-py2-amazonlinux-2-2019-2-py2 |
40 |
| - # - INSTANCE: v201902-py3-debian-9-2019-2-py3 |
41 |
| - # - INSTANCE: v201902-py3-ubuntu-1804-2019-2-py3 |
42 |
| - # - INSTANCE: v201902-py3-centos-7-2019-2-py3 |
43 |
| - - INSTANCE: v201902-py3-fedora-30-2019-2-py3 |
44 |
| - - INSTANCE: v201902-py3-opensuse-leap-15-2019-2-py3 |
45 |
| - |
| 18 | +## Script to run for the test stage |
46 | 19 | script:
|
47 |
| - - bin/kitchen verify ${INSTANCE} |
| 20 | + - bin/kitchen verify "${INSTANCE}" |
48 | 21 |
|
| 22 | +## Stages and jobs matrix |
| 23 | +stages: |
| 24 | + - test |
| 25 | + - name: 'release' |
| 26 | + if: 'branch = master AND type != pull_request' |
49 | 27 | jobs:
|
50 | 28 | include:
|
51 |
| - # Define the `lint` stage (runs `yamllint` and `commitlint`) |
52 |
| - - stage: lint |
53 |
| - language: node_js |
54 |
| - node_js: lts/* |
55 |
| - before_install: skip |
| 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' |
56 | 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 |
57 | 42 | # Install and run `yamllint`
|
58 | 43 | # Need at least `v1.17.0` for the `yaml-files` setting
|
59 | 44 | - pip install --user yamllint>=1.17.0
|
60 | 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 |
61 | 53 | # Install and run `commitlint`
|
62 |
| - - npm install @commitlint/config-conventional -D |
63 |
| - - npm install @commitlint/travis-cli -D |
| 54 | + - npm i -D @commitlint/config-conventional |
| 55 | + @commitlint/travis-cli |
64 | 56 | - commitlint-travis
|
65 |
| - # Define the release stage that runs `semantic-release` |
66 |
| - - stage: release |
67 |
| - language: node_js |
68 |
| - node_js: lts/* |
69 |
| - before_install: skip |
| 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 | + # The ordering used below has been selected based on the time required in Travis |
| 62 | + # The slower ones are kept as high up as possible, to run concurrently rather than |
| 63 | + # slow down the entire run at the end (i.e. `centos-6` and `opensuse`) |
| 64 | + # However, the groupings needed to be maintained in some semblance of order |
| 65 | + # so this is a best-effort matrix, in the circumstances |
| 66 | + # - env: INSTANCE=v201707-py2-debian-8-2017-7-py2 |
| 67 | + - env: INSTANCE=v201707-py2-ubuntu-1604-2017-7-py2 |
| 68 | + - env: INSTANCE=v201707-py2-centos-6-2017-7-py2 |
| 69 | + # - env: INSTANCE=v201707-py2-amazonlinux-2-2017-7-py2 |
| 70 | + # - env: INSTANCE=v201707-py2-arch-base-latest-2017-7-py2 |
| 71 | + - env: INSTANCE=v201803-py2-debian-9-2018-3-py2 |
| 72 | + # - env: INSTANCE=v201803-py2-ubuntu-1604-2018-3-py2 |
| 73 | + - env: INSTANCE=v201803-py2-centos-7-2018-3-py2 |
| 74 | + # - env: INSTANCE=v201803-py2-amazonlinux-2-2018-3-py2 |
| 75 | + # - env: INSTANCE=v201803-py2-arch-base-latest-2018-3-py2 |
| 76 | + - env: INSTANCE=v201902-py2-ubuntu-1804-2019-2-py2 |
| 77 | + # - env: INSTANCE=v201902-py2-centos-7-2019-2-py2 |
| 78 | + - env: INSTANCE=v201902-py2-amazonlinux-2-2019-2-py2 |
| 79 | + # - env: INSTANCE=v201902-py2-arch-base-latest-2019-2-py2 |
| 80 | + - env: INSTANCE=v201902-py3-debian-10-2019-2-py3 |
| 81 | + # - env: INSTANCE=v201902-py3-debian-9-2019-2-py3 |
| 82 | + # - env: INSTANCE=v201902-py3-ubuntu-1804-2019-2-py3 |
| 83 | + # - env: INSTANCE=v201902-py3-centos-8-2019-2-py3 |
| 84 | + - env: INSTANCE=v201902-py3-opensuse-leap-151-2019-2-py3 |
| 85 | + |
| 86 | + ## Define the release stage that runs `semantic-release` |
| 87 | + - stage: 'release' |
| 88 | + language: 'node_js' |
| 89 | + node_js: 'lts/*' |
| 90 | + env: 'Release' |
| 91 | + name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' |
| 92 | + before_install: 'skip' |
70 | 93 | script:
|
71 | 94 | # Update `AUTHORS.md`
|
72 | 95 | - export MAINTAINER_TOKEN=${GH_TOKEN}
|
73 | 96 | - go get github.com/myii/maintainer
|
74 | 97 | - maintainer contributor
|
75 | 98 |
|
76 | 99 | # Install all dependencies required for `semantic-release`
|
77 |
| - - npm install @semantic-release/changelog@3 -D |
78 |
| - - npm install @semantic-release/exec@3 -D |
79 |
| - - npm install @semantic-release/git@7 -D |
| 100 | + - npm i -D @semantic-release/changelog@3 |
| 101 | + @semantic-release/exec@3 |
| 102 | + @semantic-release/git@7 |
80 | 103 | deploy:
|
81 |
| - provider: script |
82 |
| - skip_cleanup: true |
83 |
| - script: |
84 |
| - # Run `semantic-release` |
85 |
| - - npx semantic-release@15 |
| 104 | + provider: 'script' |
| 105 | + # Opt-in to `dpl v2` to complete the Travis build config validation (beta) |
| 106 | + # * https://docs.travis-ci.com/user/build-config-validation |
| 107 | + # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default |
| 108 | + edge: true |
| 109 | + # Run `semantic-release` |
| 110 | + |
0 commit comments