[TOOL] GitHub Actions - Workflow to compile mods online

Started by krafs, December 01, 2019, 11:44:45 AM

Previous topic - Next topic

krafs

I've made a workflow on GitHub that is triggered whenever my mod repository receives a pushed commit. It then proceeds to build the mod online, on three virtual environments: Windows, Ubuntu and MacOS, and notifies me if a build has failed.

Why?
This kind of functionality falls into the category of Continuous Integration (and other closely related concepts). The main benefit is for teams of developers working on the same code being confident the branch they're working on isn't broken - by continuously integrating their changes to the main code branch. You can read more about CI/CD here.

However, it can also benefit single developers by ensuring that building a project not only works under the specific conditions of one's local machine, but on any machine, regardless of operating system. It also opens up for a variety of other things you might want to do with your mod, like zip it and upload as a release, or send emails about successful builds. You can even make your own actions to do pretty much anything you want. It can also be fun. Because automating things is fun :)

Feel free to have a look at the repository here.

GitHub Actions
GitHub Actions is a GitHub feature that allows building workflows that can be triggered by various events. Whenever a workflow is triggered, GitHub starts a virtual machine within which you can run commands, download repositories, build, test, and do all sorts of things. Read more about GitHub Actions here.

LWM

If you make a workflow that puts together a Release .zip and a Debug .zip, I will shamelessly copy it.

krafs

Quote from: LWM on December 02, 2019, 03:42:50 PM
If you make a workflow that puts together a Release .zip and a Debug .zip, I will shamelessly copy it.

It's less straightforward than just compiling a repository, as I did in RimCI, but I might give it a go.
Will update here if I do.

Feel free to copy and use anything if it's useful :)

lobz

Hi, I'm new here, and I know this topic hasn't been updated in some time but it's such a useful tool! can someone give a basic explanation of what do I have to do to integrate this in my code? Can I copy the workflow files or is there more to it?

PS.: is there a workflow for integrated automatic testing?

botlord

Krafs just merged a couple pull requests from me to update the build so it uses matrix builds instead of individual jobs as well as using dotnet to build. I'm working on a release system as well using a couple other GitHub actions. I think when I'm done, it's basically going to be a new template for creating mods lobz. Though I'll update my release stuff to the original repo as well.