![]() ![]() Lastly, we run our tests with flutter test test, while the 2nd "test" is not required, it is actually the path reference to the test folder, something I need to define in order for some of the mocking functions to work correctly within a few of my projects. The "Run Generator" step is an optional one for those of us who make use of code generation in our projects, something you can skip if you are not already running it locally. Next, we start interacting with our own code, we start by running flutter pub get so that we can install all our packages into the instance. The steps describe the order of flow for your action, which almost always will start with actions/, which is the action that checks out the code into the instance of the action.Īs we are trying to test a Flutter project, we need to install flutter into the instance, for this we are calling subosito/, but default this will install the latest stable release, but you can configure this to another release or even pin it to a specific version. GitHub exposes Linux, Windows and macOS environments for you to run actions within, as unit tests are platform agnostic, I prefer to run these against Linux, in part is it is the "cheapest" option, while for OpenSource projects you have unlimited minutes, private projects are collectively limited to 2000 minutes per month, with time multipliers based on the platform being used, you can read up about that HERE. The jobs section is where the actual work happens. Now let's dive into what is going on here.įirst, we simply start off with a name and the triggers, this action will trigger for any pull-request made against the main branch as well as on "workflow_dispatch", which is GitHub for manually. ![]() Let's get startedįirstly, let's get a look at what our result is going to look like. This can be very handy to prevent broken code from going to production, or even just as a sanity check for the code reviews. Today we going to discuss the nicely simple way in which you can use GitHub's actions to automate the unit testing for your Flutter project. ![]()
0 Comments
Leave a Reply. |