ibex-team / ibex-lib

IBEX is a C++ library for constraint processing over real numbers.
http://ibex-team.github.io/ibex-lib/
GNU Lesser General Public License v3.0
67 stars 51 forks source link

GitHub actions and packages generation #512

Open lebarsfa opened 3 years ago

lebarsfa commented 3 years ago

See #506 and #511. Note that for correct packages generation, the last GitHub tag must be in the format e.g. ibex-2.8.9 (which seemed to be the convention up to now).

cyrilbouvier commented 3 years ago

I am reading Github Actions documentation to try and understand this PR. Two quick questions:

lebarsfa commented 3 years ago

In practice, I don't think I reached any limit with GitHub actions for my projects, 2000 min per month seems reasonable to me (see e.g. the number of builds in February for https://github.com/codac-team/codac/actions).

However my Travis builds do not work since December 2020 i.e. around a month after I switched to travis-ci.com as they recommended. This seems consistent with what is said on https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing : we have only a free credit of around 1000 min, and it does not seem to reset each month... I don't think there is any limit on travis-ci.org but if I understand well it should close soon, forcing everyone to go to travis-ci.com. Since it is not the first time they say it should close soon and in the end they did not close, I think the best is to stay on travis-ci.org as long as possible while preparing an alternative to Travis in case they really close it this time, unless you want to subscribe for a paid plan on travis-ci.com...

cyrilbouvier commented 3 years ago

A few remarks:

  1. https://github.com/lebarsfa/ibex-lib/blob/a77173ead94d9c9c3df6cb368600b2f96cb019e5/.github/workflows/unixmatrix.yml#L47

Does this line still work with a Ibex version of the form 2.10.1 ?

  1. There is no step in the matrix for both Linux and Windows. Maybe you could have two matrix configurations (one for Linux packages and one for Windows packages) ?

  2. All the DEBIAN/control file in the package directory are very similair, maybe they could be generated by one of the Github Action steps (from a common template). It will help to prevent error in case one wants to change the common part of theses files.

lebarsfa commented 3 years ago
  1. I think the 5 in echo "SOFTWARE_VERSION=${git_tag:5}" >> $GITHUB_ENV is removing ibex- from ibex-2.8.9, so I would say it should be changed to echo "SOFTWARE_VERSION=$git_tag" >> $GITHUB_ENV.

  2. It could be possible to separate but if you compare e.g. https://github.com/lebarsfa/ibex-lib/runs/2706061692?check_suite_focus=true with https://github.com/lebarsfa/ibex-lib/runs/2706061703?check_suite_focus=true, about half of the file is run for both (especially build and tests steps). In my mind, macOS should be also added later and keeping everything in the same matrix could help to ensure everything works as similar as possible on the different OS, at the cost of a more hard to read code.

  3. Yes, there are also the armhf and arm64 versions that I would like to add, it is somehow in my TODO list...

cyrilbouvier commented 3 years ago
  1. Ok I think you are right, I understand it backwards (I thought it was 'get the last 5 chars').

Another question: When the actions should be run ? After every push ? On every branches or on master/main only ? Only for new tags ?

cyrilbouvier commented 3 years ago

Note that for correct packages generation, the last GitHub tag must be in the format e.g. ibex-2.8.9 (which seemed to be the convention up to now).

Wouldn't it be possible to filter the tags by having tags: 'ibex-*' in the on: push section ?

lebarsfa commented 3 years ago

At the moment I think it is supposed to run for every push whatever the branch, indeed it could be easily restricted to master branch by swapping the comments in https://github.com/lebarsfa/ibex-lib/blob/a77173ead94d9c9c3df6cb368600b2f96cb019e5/.github/workflows/unixmatrix.yml#L3-L4 I have not played much with the tag filters but it is probably possible also.

lebarsfa commented 3 years ago

For the tags, I see in https://github.com/lebarsfa/ibex-lib/blob/a77173ead94d9c9c3df6cb368600b2f96cb019e5/.github/workflows/unixmatrix.yml#L5 that it says it is restricted to blank tags. I am not sure if I remember all the reasons but it could be because we usually do not explicitly tag every commit (also depending on the way we commit) and also we often create the tags and releases directly on GitHub website from a previous commit, so it appeared to be safer to not restrict to much the tags...

cyrilbouvier commented 3 years ago

If the goal of Github Actions is to build the packages, it should only be run for master branch and tag that correspond to version, shouldn't it ?

lebarsfa commented 3 years ago

Yes, we probably just need to be careful with the way the tags are created, I remember that I got problems with that, I think that we need to ensure the tag is created in the same time as the commit or maybe the push if we activate the tag filter...