Thanks, this helps. Travis documentation isn’t very clear on the point of conditionals and how to structure them so they aren’t considered separate jobs.
My expected build should have 2 “test” jobs (one for each version of node), and one “release” job that only runs when the branch = master. Based on this conversation I think I know what that looks like, and I’m testing this config which appears to do the trick:
# Define the release stage that runs semantic-release
- stage: release
if: branch = master
# Advanced: optionally overwrite your default `script` step to skip the tests
# It may not needed if `npm run build` and `npm test` run in preversion step
script: npm run test:badges && npm run semantic-release
What would be ideal is if I can skip the entire “release” stage and not trigger any jobs (rather than generating a job that gets cancelled after installing Node).