43 lines
1.3 KiB
YAML
Raw Normal View History

2019-10-20 19:16:50 -04:00
language: node_js
cache: npm
# Trigger a push build on master and greenkeeper branches + PRs build on every branches
# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
branches:
only:
- master
- /^greenkeeper.*$/
jobs:
include:
- stage: test
node_js: 8
- node_js: 10
env: Node 10 & coverage upload
after_script:
- npm run coverage:upload
- node_js: lts/*
env: memory-test
script: npm run test:memory
- stage: release
env: semantic-release
node_js: lts/*
script: npx semantic-release
# when Greenkeeper updates @octokit/routes, run "generate-routes" script
# and push new routes.json file to the pull request
- stage: greenkeeper-routes-update
node_js: lts/*
script:
- git checkout $TRAVIS_BRANCH
- node scripts/generate-routes
# commit changes and push back to branch on GitHub. If there are no changes then exit without error
- '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'
stages:
- test
- name: release
if: branch = master AND type IN (push)
- name: greenkeeper-routes-update
if: branch =~ ^greenkeeper/@octokit/routes