-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added GitHub Actions workflows #506
Conversation
@madler consider getting rid of appveyor and use GitHub Actions. |
…est and because of madler#506
@madler: What do you think? |
138b8f4
to
79a98fb
Compare
I did some minor cleanup incase anybody cares. |
FWIW, I support this. :) Back when that other pull request was proposed, there was concern within Google about Github Actions not being secure enough. That has since changed. And given the change, I recommend using Github Actions instead of AppVeyor. It will be much easier for everyone involved, too. You'll recall last time we tried to get AppVeyor running it had more steps (each of which required confirming it is safe) than it was worth. With this, we won't need those annoying steps. It might be good to land this first. Then I can update the other pull request to not include any AppVeyor parts. That'll bring the useful test/example.c changes in. |
So I just add these files, and then, magic? Are there any settings or permissions on GitHub needed? I think I have turned off appveyor. |
Correct, magic, if you build it they will come. |
By the way, something I did not add was the ability to check to see that contribs compiled. Perhaps contrib authors can add those workflows. And I did not add checks for the vcproj files you have. Only checked cmake and configure. If there is interest I can look into some of that. |
Pull requests need to be on develop, not master. @nmoinvaz Can you resubmit? |
They should be activated for all branches. Are you saying you only want for develop? |
Yes, develop. master is only for releases. When there is a new release, the files will end up on master as well. |
You should be able to press the Edit button on this PR on the top right and change it from master to develop. |
Didn't know I could do that. Thanks! |
I'll submit a pull request to get rid of AppVeyor. That "build failed" just then is annoying. :) |
Oh. The AppVeyor files didn't land. I think the error is because the AppVeyor account is linked here but isn't finding any files instructing it. You can probably log into AppVeyor and remove zlib from the repos for it to check. |
@ProgramMax I have deleted zlib from appveyor. Hopefully it has been exorcised now. |
Sounds good. |
0c61909
to
75fc8b3
Compare
Please don't force push into pull requests when it isn't necessary for the future. Reviewers have to start again to review the entire pull request instead of just the new changes. Additionally, you don't give any credits to the reviewers for code suggestions. |
There are pros and cons of each way.
I'm not sure that it makes sense for EVERY suggestion to be credited. The commits in zlib are always authored by @madler and he can credit whoever he wants - even all 6 participants on this PR. After having it open for 2 years I would be happy if the changes are merged even if I don't get credit. A lot of the changes I made since last push were already made by me in zlib-ng GHA workflows (which is where these workflows come from) but this PR was never updated, your suggestions I have already made there even, although the GCC issue was only partially made in zlib-ng already. |
.github/workflows/cmake.yml
Outdated
- name: Ubuntu GCC | ||
os: ubuntu-latest | ||
compiler: gcc | ||
|
||
- name: Ubuntu GCC OSB | ||
os: ubuntu-latest | ||
compiler: gcc | ||
build-dir: ../build | ||
build-src-dir: ../zlib |
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.
What is "OSB" here?
Also, isn't it normal when using CMake to:
$ mkdir build
$ cd build
$ cmake ..
Should all the CMake builds be doing that? (Which is similar but not the same to what OSB is doing.)
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.
OSB means out of source build, meaning build in a separate directory from the source directory, which is the typical case. I have reversed it, so there is now a "ISB" aka in-source-build run.
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.
I now realize why I did it in reverse, because GitHub does not allow you to upload a configure.log
from outside the source directory.
.github/workflows/fuzz.yml
Outdated
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'zlib' | ||
fuzz-seconds: 600 |
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.
I'm curious about a 10 minute fuzzer run.
On one hand, I like the idea of making sure the fuzzer works. That way we don't accidentally break it. That is the benefit of having it in the CI.
But on the other hand, we are unlikely to find problems in only 10 minutes. And we don't need it to run for 10 minutes to make sure it wasn't broken. Also, I don't think anyone wants to wait around for 10 minutes before learning if the CI approves their change.
Could this just be 30s? Do we actually want 10 minutes of fuzzing here?
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.
10 minutes might be long as you say. But there is also a cost to spooling up a new CI instance for GH so it should probably be greater than 30 seconds. I think 5 minutes is a good medium.
00e55c2
to
76ecc86
Compare
Rebased. |
On each commit these workflows will be run to verify that project generation, source file compilation, and test cases run successfully. On each pull request a workflow will be run to verify that all fuzzing tests pass successfully. madler#492
76ecc86
to
5236324
Compare
Incorporated. |
Thank you so much @nmoinvaz for this! It seems to working great. I say "seems", only because it's always giving a green check mark. I find this suspicious. I went in and looked at the output, and I didn't even see any warnings. Will this show or flag warnings from the compilations? Or only errors? |
Agreed. Thank you for doing this, @nmoinvaz. Warnings are allowed by default. Errors will not give a green check mark. We can add a flag to treat warnings as errors if we wanted. It does seem strangely quiet, though. Things which I thought would return non-zero aren't. There are 3 jobs: Ubuntu GCC, Ubuntu GCC ISB, and macOS GCC. So I think we have some follow-up work to do. But it is correctly building and testing on Ubuntu GCC ISB. |
Oops. Let me correct myself: |
What is "GCC ISB"? |
ISB = In-Source Build. For CMake, it is common to: |
@ProgramMax is right. And configure When I created this PR 2 years ago, there were some CI instances I knew weren't working, but I decided to only go with those that were working first (I don't remember which ones failed). It also may have been something incompatible with zlib CMake/configure itself. I can add more CI instances to the workflows (ARM, etc) in another PR. |
Also we don't check building of any contribs. |
That's fine for now. The only one we might eventually want to add is minizip. I check that one in my internal tests. |
Description:
Supports the following CI configurations:
Example runs can be found here:
https://github.com/nmoinvaz/zlib/actions
This PR does not change any source code and only adds yaml workflows. Take from this PR what you need.