szwacz / electron-boilerplate

Boilerplate application for Electron runtime
MIT License
3.13k stars 489 forks source link

Support for GitLab CI #222

Closed pkunze closed 7 years ago

pkunze commented 8 years ago

I noticed the discussion when it comes to AppVeyor and cross-platform-builds.

I played around with GitLab CI and the boilerplate and got it working. However, GitLab CI only supports linux which would be a little tradeoff. Other than that, IMO it doenÄt hurt since it would only add one file .gitlab-ci.yml. It would be working oob on GitLab and I set it up to persit the Release-Artifacts as well as the coverage report for later download on the pipeline which is quite nice.

Would this be something desirable @szwacz?

pkunze commented 7 years ago

ups

Sirius-A commented 7 years ago

I'd also like to have oob support for GitLab CI.

@pkunze Can you share your .gitlab-ci.yml :blush: ?

szwacz commented 7 years ago

@pkunze could you please elaborate more on the topic? I'm not familiar with GitLab CI, nor what the probelm is :), would you like to replace it for existing CIs?

Sirius-A commented 7 years ago

I use GitLab as a central code repository for all project within my company.

GitLab comes with built-in CI runners, which trigger for each commit. The runners can be configured with a .gitlab-ci.yml file.

This issue suggests to add such a file, so people using GitLab can use the CI checks and builds out of the box. (No changes for Travis or AppVeyor. )

@pkunze feel free to correct me :D

pkunze commented 7 years ago

@Sirius-A yeah, right.
@szwacz: Nothings wrong with App-Veyor and Travis at all. However, GitLab has it's own built in CI System which integrates great into the platform, so for those using the boilerplate on GitLab, having a pre-configured .gitlab-ci.yml-file would be a great benefit because they could push their code and would have CI immediately available at no extra (configuration) cost, since GitLab automatically enables CI when a .gitlab-ci.yml-file is present (while setting up a good one can be quite a task for people unfamiliar with the GitLab-CI system).

So I am notsuggesting to get rid of Travis and AppVeyor, but to add a preconfigured .gitlab-ci.yml-file as a complement for GitLab Users.

Some features I have tried out so far are:

However, due to the lack of good dockerimages for running electron the build is quite slow. Maybe, someone here has a good idea to speed things up unti GitLab speeds up the builds itsself (they've got some things up in line on that issue).

I'll set up a demo-project and paste a link here for you to see.

szwacz commented 7 years ago

Thanks for great explanation. I see your point, but for all people not using gitlab this file is useless, and this actually opens up a precedent for other CIs, If we already have 3, why not adding also CircleCI and how many more are there ;)

How about solving this problem just by creating gists of files like .gitlab-ci.yml and linking them in readme of electron-boilerplate? "Hey I you're interested in GitLab CI then here is extra file for you and remove travis and appveyor."

pkunze commented 7 years ago

That was my concern too. I think I'll provide an example config and submit a PR with an updated CI section of the readme.

pkunze commented 7 years ago

For anyone interested in this issue, i've created a gitlab ci file in a little fork on gitlab for anybody to see:

https://gitlab.com/nozzleman101/electron-boilerplate/pipelines/4981018

The ci-file can be seen here: https://gitlab.com/nozzleman101/electron-boilerplate/blob/master/.gitlab-ci.yml

Currently, it features jobs for everything I got to work:

Those jobs are seperated in two stages (test and bundle), a third stage for the pages deployment is added by gitlab automatically.

Edit: Note that this is from January, i just forgot to post it, so its not the current State of the project here on github ;)

Also: The build is fairly slow to begin with, but this can be accelerated by creating custom Docker Images for the build and/or registering a dedicated runner (i used shared runners)