Saltstack Official Syslog-NG Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.3KB

  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. ## Language and cache config
  10. language: 'ruby'
  11. cache: 'bundler'
  12. ## Stages and jobs matrix
  13. stages:
  14. - test
  15. - name: 'release'
  16. if: 'branch = master AND type != pull_request'
  17. jobs:
  18. allow_failures:
  19. - env: Lint_rubocop
  20. fast_finish: true
  21. include:
  22. ## Define the test stage that runs the linters (and testing matrix, if applicable)
  23. # Run all of the linters in a single job (except `rubocop`)
  24. - language: 'node_js'
  25. node_js: 'lts/*'
  26. env: 'Lint'
  27. name: 'Lint: salt-lint, yamllint, shellcheck & commitlint'
  28. before_install: 'skip'
  29. script:
  30. # Install and run `salt-lint`
  31. - pip install --user salt-lint
  32. - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
  33. | xargs salt-lint
  34. # Install and run `yamllint`
  35. # Need at least `v1.17.0` for the `yaml-files` setting
  36. - pip install --user yamllint>=1.17.0
  37. - yamllint -s .
  38. # Run `shellcheck` (already pre-installed in Travis)
  39. - shellcheck --version
  40. - git ls-files -- '*.sh' '*.bash' '*.ksh'
  41. | xargs shellcheck
  42. # Install and run `commitlint`
  43. - npm i -D @commitlint/config-conventional
  44. @commitlint/travis-cli
  45. - commitlint-travis
  46. # Run the `rubocop` linter in a separate job that is allowed to fail
  47. # Once these lint errors are fixed, this can be merged into a single job
  48. - language: node_js
  49. node_js: lts/*
  50. env: Lint_rubocop
  51. name: 'Lint: rubocop'
  52. before_install: skip
  53. script:
  54. # Install and run `rubocop`
  55. - gem install rubocop
  56. - rubocop -d
  57. ## Define the release stage that runs `semantic-release`
  58. - stage: 'release'
  59. language: 'node_js'
  60. node_js: 'lts/*'
  61. env: 'Release'
  62. name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
  63. before_install: 'skip'
  64. script:
  65. # Update `AUTHORS.md`
  66. - export MAINTAINER_TOKEN=${GH_TOKEN}
  67. - go get github.com/myii/maintainer
  68. - maintainer contributor
  69. # Install all dependencies required for `semantic-release`
  70. - npm i -D @semantic-release/changelog@3
  71. @semantic-release/exec@3
  72. @semantic-release/git@7
  73. deploy:
  74. provider: 'script'
  75. # Opt-in to `dpl v2` to complete the Travis build config validation (beta)
  76. # * https://docs.travis-ci.com/user/build-config-validation
  77. # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
  78. edge: true
  79. # Run `semantic-release`
  80. script: 'npx semantic-release@15.14'
  81. # Notification options: `always`, `never` or `change`
  82. notifications:
  83. webhooks:
  84. if: 'repo = saltstack-formulas/syslog-ng-formula'
  85. urls:
  86. - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fsyslog-ng-formula&ignore_pull_requests=true
  87. on_success: always # default: always
  88. on_failure: always # default: always
  89. on_start: always # default: never
  90. on_cancel: always # default: always
  91. on_error: always # default: always