Skip to content

Add Cirrus CI; add --force_fail and --fail_fast options to example.c#495

Closed
dankegel wants to merge 21 commits intomadler:developfrom
dankegel:develop
Closed

Add Cirrus CI; add --force_fail and --fail_fast options to example.c#495
dankegel wants to merge 21 commits intomadler:developfrom
dankegel:develop

Conversation

@dankegel
Copy link
Copy Markdown
Contributor

@dankegel dankegel commented May 19, 2020

I wanted to make this a pull request against https://github.com/ProgramMax/zlib/tree/develop
but Github won't let me, so here it is against madler's develop branch.
It's just Chris's branch plus --force_fail and --fail_fast options to example.c that I found useful,
as well as cirrus-ci builds on BSD, mac, linux, and windows.

The README now shows status badges for both Appveyor and Cirrus; see https://github.com/dankegel/zlib/tree/develop for what it looks like when the git repo has those two services enabled.

When cirrus-ci builds fail, Github displays test failures with links to source lines,
see example at https://github.com/dankegel/zlib/pull/3/checks?check_run_id=690339991
Perhaps more usefully, in pull requests they also show up in the 'Files changed' tab, see example at https://github.com/dankegel/zlib/pull/3/files (and scroll down to the 'Unchanged files with check annotations' section!).

(This pull request used to also add Linux builds via travis-ci.org and drone.io for Power, S390x, and Arm, but I've banished those to https://github.com/dankegel/zlib/commits/moreci for now.)

ProgramMax and others added 13 commits May 17, 2020 13:25
To make it easier to accept contributions to zlib we should establish automated testing.

This commit uses the existing test/example.c testing. It connects those tests to AppVeyor, allowing AppVeyor to mark commits as passing or failing the tests. It also automatically runs tests when a pull request is submitted or updated.

There is some room for future expansion enabled, such as tracking the file and line of a failing test. This is thanks to @dankegel, who also got this working on CI providers other than AppVeyor.
@dankegel dankegel changed the title Add CI on Mac, BSD, and Linux Add CI on Mac, BSD, and Linux on Power, ARM, and S390x May 19, 2020
@ProgramMax
Copy link
Copy Markdown

If you want to merge the two pull requests, you can save your changes off to the side and delete your fork of madler/zlib. Then fork my zlib, fetch it, reapply your changes, upload, and submit a pull request to my fork. Once included in my fork it becomes included in my pull request.

@ProgramMax
Copy link
Copy Markdown

You'll probably want to add badges to the README.md to indicate which builds are passing / failing.

dankegel added 7 commits May 19, 2020 11:51
…rus/github

Also don't output file or line on success, since annotating those on github just adds clutter.
CMakeLists.txt: output junit result file for each test executable to ${CMAKE_CURRENT_BINARY_DIRECTORY}.

(Would have liked to output them to the $<CONFIG> subdir on Windows
for multi-config generators like Visual Studio, but
alas, I couldn't coax cmake's generator expressions
into working portably without complicating CMakeLists.txt
beyond reason.  Happily, it's uncommon to run both
Release and Debug build and test in same tree on CI builders.)
@dankegel dankegel changed the title Add CI on Mac, BSD, and Linux on Power, ARM, and S390x Add Cirrrus CI; add --force_fail and --fail_fast options to example.c May 19, 2020
@dankegel
Copy link
Copy Markdown
Contributor Author

OK, badge added. (Annoyingly, looks like Chrome caches badges aggressively.)

I hesitate to delete my repo... that's given me trouble in the past. Could you consider the following commands instead?

git remote add dank https://github.com/dankegel/zlib
git fetch dank
git checkout -b dank-develop dank/develop
git checkout develop
git merge --ff-only dank-develop

?

@dankegel dankegel changed the title Add Cirrrus CI; add --force_fail and --fail_fast options to example.c Add Cirrus CI; add --force_fail and --fail_fast options to example.c May 19, 2020
@dankegel
Copy link
Copy Markdown
Contributor Author

Or you could just land yours and I could rebase this one afterwards.

@ProgramMax
Copy link
Copy Markdown

That option works for me. :)

@mscastanho
Copy link
Copy Markdown

@dankegel, there is a simpler way to do this. You can just add @ProgramMax's fork as a remote on your local zlib repo:

git remote add gh-programmax https://github.com/ProgramMax/zlib.git

Create a branch based on the branch he used to open his PR (develop):

git fetch gh-programmax develop:ci-integration 

(here the local branch will be called ci-integration)
add your changes to this branch, then push it to your own GitHub fork:

git push origin ci-integration

(assuming you have your own zlib fork on GitHub as the origin git remote)

And then open a PR from your ci-integration (or other name you used) to @ProgramMax 's develop branch on his fork. Once he merges the changes there, GitHub will automatically update PR #492 with your changes.

@dankegel
Copy link
Copy Markdown
Contributor Author

Well, yes, that is what I tried to do. I rebase onto his branch whenever he updates it.
But when when I try to create a PR from my branch to @ProgramMax's develop branch, github does not give me the option; his branch is missing from the list of allowed targets; here's what I see: http://kegel.com/github-hates-me.png

Evidently this is a known issue with github:
http://srcmvn.com/blog/2013/03/14/sending-a-pull-request-on-github-even-when-the-base-repository-you-want-is-missing

The suggested workaround is to construct a URL like https://github.com/DanKegel/zlib/pull/new/ProgramMax:develop...DanKegel:develop
and sure enough, that worked! See ProgramMax#2

Closing in favor of ProgramMax#2 for now.

@dankegel dankegel closed this May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants