|
| 1 | +stages: |
| 2 | + - test |
| 3 | + - commitlint |
| 4 | + - name: release |
| 5 | + if: branch = master AND type != pull_request |
| 6 | + |
| 7 | +sudo: required |
| 8 | +cache: bundler |
| 9 | +language: ruby |
| 10 | + |
| 11 | +services: |
| 12 | + - docker |
| 13 | + |
| 14 | +# Make sure the instances listed below match up with |
| 15 | +# the `platforms` defined in `kitchen.yml` |
| 16 | +# NOTE: Please try to select up to six instances that add some meaningful |
| 17 | +# testing of the formula's behaviour. If possible, try to refrain from |
| 18 | +# the classical "chosing all the instances because I want to test on |
| 19 | +# another/all distro/s" trap: it will just add time to the testing (see |
| 20 | +# the discussion on #121). As an example, the set chosen below covers |
| 21 | +# the most used distros families, systemd and non-systemd and the latest |
| 22 | +# three supported Saltstack versions with python2 and 3." |
| 23 | +# As for `kitchen.yml`, that should still contain all of the platforms, |
| 24 | +# to allow for comprehensive local testing |
| 25 | +# Ref: https://github.com/saltstack-formulas/template-formula/issues/118 |
| 26 | +# Ref: https://github.com/saltstack-formulas/template-formula/issues/121 |
| 27 | +env: |
| 28 | + matrix: |
| 29 | + # Disable tests on Salt develop for now |
| 30 | + # See: https://travis-ci.com/saltstack-formulas/php-formula/jobs/211316835 |
| 31 | + # - INSTANCE: default-debian-9-develop-py3 |
| 32 | + # - INSTANCE: default-ubuntu-1804-develop-py3 |
| 33 | + # - INSTANCE: default-centos-7-develop-py3 |
| 34 | + # - INSTANCE: default-fedora-29-develop-py3 |
| 35 | + # - INSTANCE: default-opensuse-leap-15-develop-py3 |
| 36 | + # - INSTANCE: default-debian-9-2019-2-py3 |
| 37 | + - INSTANCE: default-ubuntu-1804-2019-2-py3 |
| 38 | + - INSTANCE: default-centos-7-2019-2-py3 |
| 39 | + # - INSTANCE: default-fedora-29-2019-2-py3 |
| 40 | + # - INSTANCE: default-opensuse-leap-15-2019-2-py3 |
| 41 | + # - INSTANCE: default-debian-9-2018-3-py2 |
| 42 | + # - INSTANCE: default-ubuntu-1604-2018-3-py2 |
| 43 | + # - INSTANCE: default-centos-7-2018-3-py2 |
| 44 | + - INSTANCE: default-fedora-29-2018-3-py2 |
| 45 | + # TODO: Use this when fixed instead of `opensuse-leap-42` |
| 46 | + # Ref: https://github.com/netmanagers/salt-image-builder/issues/2 |
| 47 | + # - INSTANCE: default-opensuse-leap-15-2018-3-py2 |
| 48 | + - INSTANCE: default-opensuse-leap-42-2018-3-py2 |
| 49 | + # - INSTANCE: default-debian-8-2017-7-py2 |
| 50 | + # - INSTANCE: default-ubuntu-1604-2017-7-py2 |
| 51 | + # TODO: Enable after improving the formula to work with other than `systemd` |
| 52 | + - INSTANCE: default-centos-6-2017-7-py2 |
| 53 | + # - INSTANCE: default-fedora-28-2017-7-py2 |
| 54 | + # - INSTANCE: default-opensuse-leap-42-2017-7-py2 |
| 55 | + |
| 56 | +script: |
| 57 | + - bundle exec kitchen verify ${INSTANCE} |
| 58 | + |
| 59 | +jobs: |
| 60 | + include: |
| 61 | + # Define the commitlint stage |
| 62 | + - stage: commitlint |
| 63 | + language: node_js |
| 64 | + node_js: lts/* |
| 65 | + before_install: skip |
| 66 | + script: |
| 67 | + - npm install @commitlint/config-conventional -D |
| 68 | + - npm install @commitlint/travis-cli -D |
| 69 | + - commitlint-travis |
| 70 | + # Define the release stage that runs semantic-release |
| 71 | + - stage: release |
| 72 | + language: node_js |
| 73 | + node_js: lts/* |
| 74 | + before_install: skip |
| 75 | + script: |
| 76 | + # Update `AUTHORS.md` |
| 77 | + - export MAINTAINER_TOKEN=${GH_TOKEN} |
| 78 | + - go get github.com/myii/maintainer |
| 79 | + - maintainer contributor |
| 80 | + |
| 81 | + # Install all dependencies required for `semantic-release` |
| 82 | + - npm install @semantic-release/changelog@3 -D |
| 83 | + - npm install @semantic-release/exec@3 -D |
| 84 | + - npm install @semantic-release/git@7 -D |
| 85 | + deploy: |
| 86 | + provider: script |
| 87 | + skip_cleanup: true |
| 88 | + script: |
| 89 | + # Run `semantic-release` |
| 90 | + - npx semantic-release@15 |
0 commit comments