3 ms·
My experience with GitHub Actions has dramatically shifted as of last week. My first attempt at using them was catastrophic, and I decided it would never work f
by bob1029 7y ago
My experience with GitHub Actions has dramatically shifted as of last week. My first attempt at using them was catastrophic, and I decided it would never work for us. Fast forward about 2 months and everything seems to be working perfectly now. Setting up a test build for PRs on a .NET Core solution took ~10 lines of YAML, and we were in business. The ability to monitor the builds in real-time as well as link to specific line #s in each respective action log is an incredible feature. We will definitely be using this to link issues to build failures. Also, the ability to see how a build script will perform scoped to its PR means that you can review and approve not only the code aspect, but also any required changes to the build/deploy pipeline. Atomic commits across source & CI/CD is a very compelling idea.
One final aspect we started investigating was how we could completely eliminate Jenkins from our stack. We have some deeply-customized jobs that run on that box (for handling bundling of build artifacts, managing metadata for final public releases, etc). What we will likely do is write a post-build agent in .NET Core, include it within the same project repository it will be responsible for working with, and then as part of the solution build it would just get taken care of automatically. Then, we simply need to invoke one more command after our initial dotnet build to trigger the package/deployment process, all from GitHub's machines.
If anyone from the GitHub team is browsing here, I was wondering if there were any plans for caching Action state between builds. That is to say, instead of downloading & installing the .NET Core 2.2 runtime every time an action executes, it could load from some cached instance (if available). This is the only downside I see right now - Jenkins can usually turn our check builds around in about 50% the time of the GitHub Actions, but for our purposes right now we honestly don't mind it. PRs don't need to merge every 60 seconds. Once we get to release builds in GitHub Actions, I think that tune might change a little bit.
- mark242 7y agoYou should probably set up a custom Docker container to act as your "cached instance". If you're doing the same setup steps over and over for each build, and these setup steps are immutable, just throw them into a Dockerfile and create your own custom action environment.
- cstuder 7y agoGitHub provides an action which might be the one you're looking for: https://github.com/actions/setup-dotnet https://github.com/actions/setup-dotnet If you set a specific version, it can use a cached image and is a lot faster than a complete install. Also have a look at their other `setup-*` actions for similar installations of Node, Python, Go...
- bob1029 7y agoYep - This is exactly what we are using right now. It is still a bit slower compared to having it pre-installed on something like a persistent Jenkins instance, but it's such a marginal difference that we will probably overlook it assuming that new caching features roll out eventually.
- httgp 7y agoI don't have a link handy but I remember someone asking for cached builds on Twitter and Nat Friedman responding that they were working on it! EDIT: Found it! https://twitter.com/natfriedman/status/1164210683979812869 https://twitter.com/natfriedman/status/1164210683979812869 Looks like it is landing on November 13.
- o-__-o 7y agoAlways assume big enhancements and fixes to come around satellite or universe. Two major releases a year is a safe run
- ethomson 7y agoThanks for the feedback. We're working on caching now, which will help you with your built artifacts between runs. We're also working to tune the list of pre-installed software so that the more common packages (like .NET Core 2.2) are already on the runners and you don't need to download (or cache) them.