travis: Avoid unnecessarily setting env variables on the lint build #13729

pull Empact wants to merge 3 commits into bitcoin:master from Empact:ci-lint-env changing 1 files +4 −6
  1. Empact commented at 10:45 PM on July 20, 2018: member

    The relevent env variables are set for the matrix builds, and are irrelevant to the lint build. By default the first matrix entry is applied.

    "Each job included in jobs.include inherits the first value of the array that defines a matrix dimension." https://docs.travis-ci.com/user/build-stages/#Build-Stages-and-Build-Matrix-Expansion

    Note the global env variables are still applied, just the matrix are excluded: https://travis-ci.org/bitcoin/bitcoin/jobs/406455565#L558

    Before: <img width="755" alt="screen shot 2018-07-20 at 19 16 45" src="https://user-images.githubusercontent.com/5470/43029041-81e5fd14-8c51-11e8-9e2a-6c4bcbb36d2c.png">

    After: <img width="702" alt="screen shot 2018-07-20 at 19 23 05" src="https://user-images.githubusercontent.com/5470/43029187-5ec76b28-8c52-11e8-8b03-5bee859c0d96.png">

  2. Avoid unnecessarily setting env variables on the lint build
    The relevent env variables are set for the matrix builds, and are irrelevant
    to the lint build. By default the first matrix entry is applied.
    
    "Each job included in jobs.include inherits the first value of the array that defines a matrix dimension."
    https://docs.travis-ci.com/user/build-stages/#Build-Stages-and-Build-Matrix-Expansion
    1be5c33333
  3. fanquake added the label Scripts and tools on Jul 21, 2018
  4. MarcoFalke commented at 12:50 AM on July 21, 2018: member

    Since the global vars are still exported, this doen't really matter, imo. But utACK, does no harm either.

  5. in .travis.yml:87 in 1be5c33333 outdated
      80 | @@ -81,6 +81,7 @@ after_script:
      81 |  jobs:
      82 |    include:
      83 |      - stage: lint
      84 | +      env:
      85 |        sudo: false
      86 |        cache: false
      87 |        addons:
    


    MarcoFalke commented at 12:51 AM on July 21, 2018:

    As you touch this file, might as well do some other cleanup and e.g. remove the apt addon stage completely. The installation is not needed (and only consumes time). See diff, that I confirmed to be working:

    diff --git a/.travis.yml b/.travis.yml
    index ec78896f44..c03a2bea24 100644
    --- a/.travis.yml
    +++ b/.travis.yml
    @@ -82,13 +82,10 @@ jobs:
         - stage: lint
           sudo: false
           cache: false
    -      addons:
    -        apt:
    -          packages:
    -            - python3-pip
    -            - shellcheck
    +      language: python
    +      python: '3.6'
           install:
    -        - travis_retry pip3 install flake8 --user
    +        - travis_retry pip install flake8
           before_script:
             - git fetch --unshallow
           script:
    

    Empact commented at 9:08 PM on July 21, 2018:

    Nice, 26 seconds saved: before after

  6. fanquake commented at 4:37 AM on July 21, 2018: member

    Concept ACK. Additional cleanups also look ok.

  7. Empact force-pushed on Jul 21, 2018
  8. Don't unnecessarily install shellcheck on the lint build
    "Travis CI has now integrated ShellCheck by default, so you don't need to manually install it."
    https://github.com/koalaman/shellcheck#travis-ci
    515348f704
  9. Use the Travis python language feature on the lint build
    Rather than installing python via apt.
    
    https://docs.travis-ci.com/user/languages/python/
    751c9587d4
  10. Empact force-pushed on Jul 21, 2018
  11. MarcoFalke commented at 5:01 PM on July 21, 2018: member

    utACK 751c9587d42b4c603ef85e5e846a96b2e9dd7590

  12. MarcoFalke added the label Tests on Jul 21, 2018
  13. MarcoFalke removed the label Scripts and tools on Jul 21, 2018
  14. MarcoFalke renamed this:
    Scripts and tools: Avoid unnecessarily setting env variables on the lint build
    travis: Avoid unnecessarily setting env variables on the lint build
    on Jul 21, 2018
  15. fanquake commented at 3:29 AM on July 22, 2018: member

    utACK 751c958

  16. MarcoFalke merged this on Jul 22, 2018
  17. MarcoFalke closed this on Jul 22, 2018

  18. MarcoFalke referenced this in commit aa9429a197 on Jul 22, 2018
  19. Empact deleted the branch on Jul 22, 2018
  20. MarcoFalke locked this on Sep 8, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me