|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 | # vim: ft=yaml
|
3 | 3 | ---
|
| 4 | +## Machine config |
4 | 5 | dist: bionic
|
5 |
| -stages: |
6 |
| - - test |
7 |
| - - lint |
8 |
| - - name: release |
9 |
| - if: branch = master AND type != pull_request |
10 |
| - |
11 | 6 | sudo: required
|
12 |
| -cache: bundler |
13 |
| -language: ruby |
14 |
| - |
15 | 7 | services:
|
16 | 8 | - docker
|
17 | 9 |
|
18 |
| -# Make sure the instances listed below match up with |
19 |
| -# the `platforms` defined in `kitchen.yml` |
20 |
| -env: |
21 |
| - matrix: |
22 |
| - - INSTANCE: repositories-debian-10-develop-py3 |
23 |
| - # - INSTANCE: preferences-debian-10-develop-py3 |
24 |
| - # - INSTANCE: repositories-ubuntu-1804-develop-py3 |
25 |
| - # - INSTANCE: preferences-ubuntu-1804-develop-py3 |
26 |
| - - INSTANCE: repositories-debian-9-2019-2-py3 |
27 |
| - - INSTANCE: preferences-debian-9-2019-2-py3 |
28 |
| - - INSTANCE: repositories-ubuntu-1804-2019-2-py3 |
29 |
| - - INSTANCE: preferences-ubuntu-1804-2019-2-py3 |
| 10 | +## Language and cache config |
| 11 | +language: ruby |
| 12 | +cache: bundler |
30 | 13 |
|
| 14 | +## Script to run for the test stage |
31 | 15 | script:
|
32 |
| - - bin/kitchen verify ${INSTANCE} |
| 16 | + - bin/kitchen verify "${INSTANCE}" |
33 | 17 |
|
| 18 | +## Stages and jobs matrix |
| 19 | +stages: |
| 20 | + - test |
| 21 | + - name: release |
| 22 | + if: branch = master AND type != pull_request |
34 | 23 | jobs:
|
35 | 24 | include:
|
36 |
| - # Define the `lint` stage (runs `yamllint` and `commitlint`) |
37 |
| - - stage: lint |
38 |
| - language: node_js |
| 25 | + ## Define the test stage that runs the linters (and testing matrix, if applicable) |
| 26 | + |
| 27 | + # Run all of the linters in a single job |
| 28 | + - language: node_js |
39 | 29 | node_js: lts/*
|
| 30 | + env: Lint |
| 31 | + name: 'Lint: salt-lint, yamllint, rubocop & commitlint' |
40 | 32 | before_install: skip
|
41 | 33 | script:
|
| 34 | + # Install and run `salt-lint` |
| 35 | + - pip install --user salt-lint |
| 36 | + - git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$' |
| 37 | + | xargs -I {} salt-lint {} |
42 | 38 | # Install and run `yamllint`
|
43 | 39 | # Need at least `v1.17.0` for the `yaml-files` setting
|
44 | 40 | - pip install --user yamllint>=1.17.0
|
45 | 41 | - yamllint -s .
|
| 42 | + # Install and run `rubocop` |
| 43 | + - gem install rubocop |
| 44 | + - rubocop -d |
46 | 45 | # Install and run `commitlint`
|
47 | 46 | - npm install @commitlint/config-conventional -D
|
48 | 47 | - npm install @commitlint/travis-cli -D
|
49 | 48 | - commitlint-travis
|
50 |
| - # Define the release stage that runs `semantic-release` |
| 49 | + |
| 50 | + ## Define the rest of the matrix based on Kitchen testing |
| 51 | + # Make sure the instances listed below match up with |
| 52 | + # the `platforms` defined in `kitchen.yml` |
| 53 | + - env: INSTANCE=repositories-debian-10-develop-py3 |
| 54 | + # - env: INSTANCE=preferences-debian-10-develop-py3 |
| 55 | + # - env: INSTANCE=repositories-ubuntu-1804-develop-py3 |
| 56 | + # - env: INSTANCE=preferences-ubuntu-1804-develop-py3 |
| 57 | + - env: INSTANCE=repositories-debian-9-2019-2-py3 |
| 58 | + - env: INSTANCE=preferences-debian-9-2019-2-py3 |
| 59 | + - env: INSTANCE=repositories-ubuntu-1804-2019-2-py3 |
| 60 | + - env: INSTANCE=preferences-ubuntu-1804-2019-2-py3 |
| 61 | + |
| 62 | + ## Define the release stage that runs `semantic-release` |
51 | 63 | - stage: release
|
52 | 64 | language: node_js
|
53 | 65 | node_js: lts/*
|
| 66 | + env: Release |
| 67 | + name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' |
54 | 68 | before_install: skip
|
55 | 69 | script:
|
56 | 70 | # Update `AUTHORS.md`
|
|
0 commit comments