.travis.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. language: node_js
  2. cache:
  3. directories:
  4. - ~/.npm
  5. - node_modules/cypress/dist
  6. # Trigger a push build on master and greenkeeper branches + PRs build on every branches
  7. # Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
  8. branches:
  9. only:
  10. - master
  11. - /^greenkeeper.*$/
  12. stages:
  13. - test
  14. - name: greenkeeper-routes-update
  15. if: branch =~ ^greenkeeper/@octokit/routes
  16. - name: release
  17. if: branch = master AND type IN (push)
  18. jobs:
  19. include:
  20. - stage: test
  21. node_js: 6
  22. script:
  23. - npm run start-fixtures-server &
  24. - sleep 3 # give server some time to start
  25. - npm run test
  26. - node_js: 8
  27. script:
  28. - npm run start-fixtures-server &
  29. - sleep 3 # give server some time to start
  30. - npm run test
  31. - node_js: 9
  32. env: Node 9, coverage upload
  33. script:
  34. - npm run start-fixtures-server &
  35. - sleep 3 # give server some time to start
  36. - npm run test
  37. - npm run coverage:upload
  38. - node_js: 4 # will be removed in v16
  39. env: Node 4, smoke test only
  40. script:
  41. - node index.js
  42. - node_js: lts/*
  43. env: browser tests
  44. script:
  45. - npm run start-fixtures-server &
  46. - sleep 3 # give server some time to start
  47. - npm run test:browser
  48. - node_js: lts/*
  49. sudo: required
  50. addons:
  51. chrome: stable
  52. env: bundle size, typescript validation
  53. script:
  54. # test bundle size
  55. - npm run build:browser
  56. - npx bundlesize
  57. # test typescript definitions
  58. - npm run validate:ts
  59. # when updating @octokit/routes, run "generate-routes" script and push
  60. # new routes.json file to the pull request
  61. - stage: greenkeeper-routes-update
  62. node_js: lts/*
  63. script:
  64. - git checkout $TRAVIS_BRANCH
  65. - npm run generate-routes
  66. # commit changes and push back to branch on GitHub. If there are no changes then exit without error
  67. - 'git commit -a -m "build: routes" --author="Octokit Bot <octokitbot@martynus.net>" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
  68. # release stage: run semantic release & update the docs
  69. - stage: release
  70. node_js: lts/*
  71. env: semantic-release
  72. script:
  73. - npm run build:flow
  74. - npm run build:ts
  75. - npm run build:browser
  76. - npm run generate-bundle-report
  77. - npm run semantic-release
  78. - node_js: lts/*
  79. env: docs update
  80. script:
  81. - npm run build:docs
  82. - npm run deploy-docs