.travis.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. dist: xenial
  2. language: python
  3. cache: pip
  4. addons:
  5. homebrew:
  6. update: true
  7. packages:
  8. - npm
  9. - pyenv
  10. jobs:
  11. include:
  12. - name: "Python 2.7 on Linux"
  13. env: NODE_GYP_FORCE_PYTHON=python2
  14. python: 2.7
  15. - name: "Node.js 6 & Python 3.8 on Linux"
  16. python: 3.8
  17. env: NODE_GYP_FORCE_PYTHON=python3
  18. before_install: nvm install 6
  19. - name: "Node.js 8 & Python 3.8 on Linux"
  20. python: 3.8
  21. env: NODE_GYP_FORCE_PYTHON=python3
  22. before_install: nvm install 8
  23. - name: "Node.js 10 & Python 3.8 on Linux"
  24. python: 3.8
  25. env: NODE_GYP_FORCE_PYTHON=python3
  26. before_install: nvm install 10
  27. - name: "Node.js 12 & Python 3.5 on Linux"
  28. python: 3.5
  29. env: NODE_GYP_FORCE_PYTHON=python3
  30. before_install: nvm install 12
  31. - name: "Node.js 12 & Python 3.6 on Linux"
  32. python: 3.6
  33. env: NODE_GYP_FORCE_PYTHON=python3
  34. before_install: nvm install 12
  35. - name: "Node.js 12 & Python 3.7 on Linux"
  36. python: 3.7
  37. env: NODE_GYP_FORCE_PYTHON=python3
  38. before_install: nvm install 12
  39. - name: "Node.js 12 & Python 3.8 on Linux"
  40. python: 3.8
  41. env: NODE_GYP_FORCE_PYTHON=python3
  42. before_install: nvm install 12
  43. - name: "Python 2.7 on macOS"
  44. os: osx
  45. osx_image: xcode11.2
  46. language: shell # 'language: python' is not yet supported on macOS
  47. env: NODE_GYP_FORCE_PYTHON=python2 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=2.7.17
  48. before_install: pyenv install $PYENV_VERSION
  49. - name: "Python 3.8 on macOS"
  50. os: osx
  51. osx_image: xcode11.2
  52. language: shell # 'language: python' is not yet supported on macOS
  53. env: NODE_GYP_FORCE_PYTHON=python3 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=3.8.0
  54. before_install: pyenv install $PYENV_VERSION
  55. - name: "Node.js 6 & Python 2.7 on Windows"
  56. os: windows
  57. language: node_js
  58. node_js: 6 # node
  59. env: >-
  60. PATH=/c/Python27:/c/Python27/Scripts:$PATH
  61. NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
  62. before_install: choco install python2
  63. - name: "Node.js 12 & Python 2.7 on Windows"
  64. os: windows
  65. language: node_js
  66. node_js: 12 # node
  67. env: >-
  68. PATH=/c/Python27:/c/Python27/Scripts:$PATH
  69. NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
  70. before_install: choco install python2
  71. - name: "Node.js 12 & Python 3.7 on Windows"
  72. os: windows
  73. language: node_js
  74. node_js: 12 # node
  75. env: >-
  76. PATH=/c/Python37:/c/Python37/Scripts:$PATH
  77. NODE_GYP_FORCE_PYTHON=/c/Python37/python.exe
  78. before_install: choco install python --version=3.7.4
  79. - name: "Node.js 12 & Python 3.8 on Windows"
  80. os: windows
  81. language: node_js
  82. node_js: 12 # node
  83. env: >-
  84. PATH=/c/Python38:/c/Python38/Scripts:$PATH
  85. NODE_GYP_FORCE_PYTHON=/c/Python38/python.exe
  86. before_install: choco install python
  87. install:
  88. - python -m pip install --upgrade flake8 pytest==4.6.6 # pytest 5 no longer supports legacy Python
  89. before_script:
  90. - python -m flake8 --version
  91. # stop the build if there are Python syntax errors or undefined names
  92. - python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
  93. # exit-zero treats all errors as warnings. Two space indentation is OK. The GitHub editor is 127 chars wide
  94. - python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics
  95. - npm install
  96. - npm list
  97. script:
  98. - node -e 'require("npmlog").level="verbose"; require("./lib/find-python")(null,()=>{})'
  99. - npm test
  100. - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest
  101. notifications:
  102. on_success: change
  103. on_failure: change # `always` will be the setting once code changes slow down