I am developing a library on github that has travis checks attached to it. I'd like to have a WIP pull request open to discuss ideas easily. There is a lot of tests set up for the project on travis, so I'd like to not trigger the tests every time I push a commit (to prevent server for being overloaded), as the code is not expected to pass anyway.
Is there a way I could do this on github without having access to travis configuration?
Are there any restrictions on build time? A build has 120 minutes to run.
The first job is to build the image and the second job is going to be to run the NPM test target.
To skip builds on a per-commit basis you can add [ci skip]
to the commit message, as described in the Docs, for example:
Before: Add blerb
.
After:Add blerb
[ci skip]
To skip all non-PR builds, you can early-exit if the TRAVIS_PULL_REQUEST
environnment variable is set to "false"
fron your .travis.yml
:
before_install: # Earliest build step
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo "Not a PR, skipping" && exit; fi
My approach is to use an alias that I defined that appends the [ci skip]
to each commit message of the current branch.
wip = "!f() { git filter-branch -f --msg-filter 'sed -e "\"s/$/ \\[ci skip\\]/g\""' ${1-master}..HEAD ; }; f"
unwip = "!f() { git filter-branch -f --msg-filter 'sed -e "\"s/ \\[ci skip\\]//g\""' ${1-master}..HEAD ; }; f"
wpush = "!f() { git wip $1 && git fpush && git unwip $1 ; }; f"
So basically what I do is simply git wpush
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With