AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.03k stars 601 forks source link

Updating Travis to only build pushes on master to prevent double buil… #299

Closed jeffctown closed 5 years ago

jeffctown commented 5 years ago

Checklist

Description

Updating Travis configuration so that we don't build PR commits twice.

AliSoftware commented 5 years ago

Does that mean that when we do a PR from feature/x to master, the CI won't trigger until the PR is actually merged into master?

Doesn't that defeat the purpose of the CI, if we only know after the fact (after merge) if it passes or not?

Or does this config means the opposite, like only build PRs targeting master but not PRs targeting other branches nor commits on master?

jeffctown commented 5 years ago

@AliSoftware sorry for not being more clear with the initial comment.

Before this change, Travis was building every pull request and any commits added to an existing pull request twice. One build for the pr and one for the push. This was my original pull request for swift 4.2, but I saw the same behavior for every new pull request and every commit pushed to an existing pull request:

screen shot 2019-03-06 at 4 13 04 pm

When you click those links you see the same exact build is run twice.

This change will not prevent pull requests from being built before a merge, it simply means they will only be built once instead of twice. We should still expect Travis to kick off a build for any new pull requests, any commits pushed to an existing pull request, and for any merges into master (for releases and to update the build status badge).

This is a screenshot of the checks for this pull request, which you can see only builds once instead of twice:

screen shot 2019-03-06 at 4 19 57 pm

Notice how the push build is gone. The reason a second build with the push label doesn't spin up is because of this change.

If the duplicate builds were there for a reason, or if you don't like this change - I'm happy to revert it. I just thought getting these next releases out would go a little quicker if we didn't have them.

AliSoftware commented 5 years ago

Oh great, perfect explanation, makes total sense then 👍 thanks!

(It has been years since I played with Travis, as I moved to circle CI for all my other OSS repos 😅)