Preamble
If you've come across this post, I assume you're already familiar with what a GitHub Action is or GUT.
If not, here's a quick overview and some links for you. Feel free to skip this part if you already know your way around.
GitHub Actions
- GitHub Actions allow you to run actions on specific events, for example, on PRs and commit pushes.
- These actions are defined using YAML files inside your GitHub Repo.
- GitHub Actions are hosted by GitHub, and you have access to Ubuntu, Windows, and MacOS hosts.
- Here are the full Docs, but continue reading, I hope it will explain itself to some extent.
GUT - Godot Unit Testing
- GUT is used to write unit and integration tests in Godot.
- What is a unit test?
- Unit Tests test a unit of your code, most times a unit will be one function, and you will call a function with some input and check if you get the desired output.
- What is integration testing?
- Integration testing simulates the actual usage of your software, instead of testing the individual component/functions. The input for integration tests, for example, is starting the game → opening the inventory and checking if the inventory is actually open. This allows you to check if all the individual parts of your program work together correctly.
- Why do you want to run tests?
- Allows you to see if you broke a part of your program without touching it.
- Simplifies Code Review (You don’t have to test every PR manually, or yolo merge).
- You get a nice green checkmark each time your tests pass ✅
What I Built