-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: lint commit message in separate Travis job #24254
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,21 @@ cache: ccache | |
os: linux | ||
matrix: | ||
include: | ||
- name: "First commit message adheres to guidelines at <a href=\"https://goo.gl/p2fr5Q\">https://goo.gl/p2fr5Q</a>" | ||
if: type = pull_request | ||
language: node_js | ||
node_js: "node" | ||
script: | ||
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then | ||
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you split this into install:
- RET=0
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST} > out.txt
RET=$?
fi
export RET
script:
- cat out.txt || true
exit $RET There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redirecting stdout to file will lose coloring (okay not a major issue 😛). But if we do want to allow folding perhaps the thing to do is split the shell script so that the first part works out the first commit (this can be the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As in |
||
fi | ||
- name: "Linter" | ||
language: node_js | ||
node_js: "node" | ||
env: | ||
- NODE=$(which node) | ||
script: | ||
- make lint | ||
# Lint the first commit in the PR. | ||
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then | ||
bash tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST} || true; | ||
fi | ||
- name: "Test Suite" | ||
addons: | ||
apt: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refs:
https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
https://docs.travis-ci.com/user/conditions-v1