filipdutescu / modern-cpp-template

A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
The Unlicense
1.69k stars 214 forks source link

[FEATURE] Control which changes trigger github actions #3

Closed php1ic closed 4 years ago

php1ic commented 4 years ago

Is your feature request related to a problem? Please describe. Typo fixes in one of the *.md files will rerun the entire CI pipeline. Depending on how long the pipeline takes to run, this may become an issue.

Describe the solution you'd like Control what triggers the CI pipeline via config.

Describe alternatives you've considered Github actions doesn't seem to support skipping via a keyword in the commit message, so not sure there is an alternative.

Provide usage examples See documentation link above

Additional context I would create a PR, but I don't know if you want to implement a whilelist or a blacklist.

filipdutescu commented 4 years ago

@php1ic sensible request. Ideally, you would have a separate branch (dev branch) which would then be merged with the master after multiple commits, but I understand the concern.

Since one might also want to run .sh, .py etc. on each change, I think the best approach would be to have a blacklist implementation, exempting .md files, for example.

I can look more into GitHub actions triggers, to ensure commit messages could or could not be used to stop triggering CI. If you wish, due to me getting to it only later today, you could also make a PR, which I will review.

Thank you for your feedback!

Zethson commented 4 years ago

@php1ic sensible request. Ideally, you would have a separate branch (dev branch) which would then be merged with the master after multiple commits, but I understand the concern.

I agree. (This is also Cookietemples default behavior. When a new project from a template is created a development branch is also created). However, I still think that @php1ic brings up a nice point. You may not care if your repository is public, since you get CI for free, but it does matter for private repos.

I would like to second the blacklisting.

@filipdutescu Note however that your blacklist will change anyways since you will then blacklist the docs folder and rst files soon. So you can play around with it and later we can very easily change that.

filipdutescu commented 4 years ago

However, I still think that @php1ic brings up a nice point. You may not care if your repository is public, since you get CI for free, but it does matter for private repos.

Yes, I am in favour of this addition, which would help those having private repos.

@filipdutescu Note however that your blacklist will change anyways since you will then blacklist the docs folder and rst files soon. So you can play around with it and later we can very easily change that.

Does not seem too hard to include more file types in the blacklist, afterall I do not need to specify the file name (from my current understanding). There might also be a way to hse commit messages, but, as @php1ic mentioned, it is not standardized in GH Actions atm. Do you have any knowledge of such capabilities?

Zethson commented 4 years ago

I would keep it simple. Just ignore md or rst files for building and testing the project. Cookietemple actually has a workflow for building the documentation. This could then work the other way around by only building when rst or png or jpg files have been edited. Wednesday, 03 June 2020, 03:27PM +02:00 from Filip Dutescu notifications@github.com :

However, I still think that @php1ic brings up a nice point. You may not care if your repository is public, since you get CI for free, but it does matter for private repos. Yes, I am in favour of this addition, which would help those having private repos. @filipdutescu Note however that your blacklist will change anyways since you will then blacklist the docs folder and rst files soon. So you can play around with it and later we can very easily change that. Does not seem too hard to include more file types in the blacklist, afterall I do not need to specify the file name (from my current understanding). There might also be a way to hse commit messages, but, as @php1ic mentioned, it is not standardized in GH Actions atm. Do you have any knowledge of such capabilities? — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or unsubscribe .

filipdutescu commented 4 years ago

@php1ic , @Zethson manage to fix the CI skipping with actual CI skipping.

Added CI Skipping

In your commit message, add [skip ci] or [ci skip] in order to not run workflows for the particular commit.

I.e.:

git commit -m "my normal commit message [skip ci]"