Skip to content
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

Separate platforms at GitHub Actions per workflow-file #313

Open
sergeyklay opened this issue Oct 2, 2020 · 12 comments
Open

Separate platforms at GitHub Actions per workflow-file #313

sergeyklay opened this issue Oct 2, 2020 · 12 comments

Comments

@sergeyklay
Copy link
Collaborator

sergeyklay commented Oct 2, 2020

Hello,

I'd like propose to separate current GitHub Actions' workflow-file to something like this:

.github/
└── workflow
    ├── linux-ci.yml
    ├── macos-ci.yml
    └── windows-ci.yml

My desire is mainly due to the fact that the current workflow configuration already looks overloaded. But we have not yet added to its matrix the various options that are present at Travis CI. In other words, it will be even more complicated. For example, take a look at current Linux job:

+ [OK]   Checkout Code
+ [OK]   Setup Common Prerequisites (Linux)
- [SKIP] Setup chocolatey Cache (Windows)
- [SKIP] Setup Common Prerequisites (macOS)
- [SKIP] Setup Common Prerequisites (Windows)
+ [OK]   Configure (Unix Debug )
- [SKIP] Configure (Windows Debug x64)
+ [OK]   Build
- [SKIP] Minimal Load Test (Windows)
+ [OK]   Test

It's obviously that 50% of workflow configuration is not used for Linux builds. A similar picture for macOS as well as Windows builds.

If we split the workflow configuration as described above, there will be some redundancy due to the fact that GitHub Actions' workflows cannot use inheritance or injection. Therefore, some configuration parts will be repeated. However, in general it will make the process easier, clearer and less error prone.

@skvadrik Let me know if you're OK with this idea and I'll prepare a PR.

@skvadrik
Copy link
Owner

skvadrik commented Oct 2, 2020

I also noticed that there are many skipped steps, and I was wondering if we can get rid of them.

From the Travis CI experience (travis.yml) I know that the main complexity is the need to support various build/test configurations (CMake/Autoconf, Debug/Release, sanitizers, skeleton tests, etc.). Duplicating all that logic for every platform may be tedious. And when the build does fail, it is not so difficult to filter out the skipped steps in the GitHub UI. Therefore I'd rather wait to see what will be the end result, and then decide on whether to separate the configs for different platforms. However, if you have a strong opinion, feel free do split now.

I'm still reading the docs trying to understand if there is a way to include other actions.

@sergeyklay
Copy link
Collaborator Author

Okay, let's leave this open for now and see what will be the end result. This is perfectly fine to me. Thank you for the feedback :)

@skvadrik
Copy link
Owner

skvadrik commented Oct 4, 2020

@sergeyklay I've come up with the following approach: 07d7491 (this is an example for Setup Common Prerequisites step). All platforms use the same common step, and the split happens at the shell level. If the inline shell scripts grow too big, it is possible to move them into external scripts and execute the scripts from run. Somehow my changes break Windows build, maybe due to an unintentional change of the working directory --- I don't know yet.

@skvadrik
Copy link
Owner

skvadrik commented Oct 4, 2020

changes break Windows build

I managed to sort it out: after changing the run defaults to bash, it was necessary change .\re2c.exe to ./re2c.exe. Hopefully it will also allow to run tests on Windows.

@sergeyklay
Copy link
Collaborator Author

sergeyklay commented Oct 4, 2020

it is possible to move them into external scripts and execute the scripts from run

Yeah, it's common practice. However, I would not like to play this card now :) My typical strategy for such tasks is: "Keep all things in one place for as long as you can so that any user can find all things together" and "Don't force users to wander around the project to understand how to build it."

  • How can I build your project using my OS?
  • Take a look at the workflow configuration and repeat all instructions step by step!

@skvadrik
Copy link
Owner

skvadrik commented Oct 4, 2020

Makes sense!

@NickStrupat
Copy link

Hi folks,

It looks like the github action for windows is generating a chocolatey package, but it doesn't appear to be updated on chocolatey.org (it's on v1.3).

@skvadrik
Copy link
Owner

Hi Nick, as far as I understand we use chocolatey in ci.yml to get bison on Windows, and it has nothing to do with the latest re2c version supported by chocolatey. Why do you say it's generating a package?

You should contact the maintainer of the package. If I'm not mistaken it's Nuno Lopes: https://github.com/nunoplopes/chocore2c, and the package is https://community.chocolatey.org/packages/re2c. Or just send a pull request there.

@sergeyklay
Copy link
Collaborator Author

I think we defenitely should build binaries for every platform and attach binaries to the release

@skvadrik
Copy link
Owner

Do you think we could extract macOS and Windows binaries from the GitHub Actions builds?

@sergeyklay
Copy link
Collaborator Author

Yes, I did this in other projects. There are artifacts, you can store after each build and then attach to a release automatically

@skvadrik
Copy link
Owner

Nice!

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

No branches or pull requests

3 participants