This will save us valuable computation time (and if you are a green person — also cut the CO2 emissions). I mean, if we set the PR as a draft, there’s no need to run all the heavy tests on it, right? Maybe just build and deploy a demo would suffice for a draft…
Armed with these tools, you can set the trigger to fit your need and build a full CI/CD flow (or actually, any automation). For instance, you can build iOS apps even if you do not have a Mac (by using a MacOS machine with a manual trigger).
#2: Reusable Workflows with Workflow Calls
Triggers are great, but this one gets a full title of its own.
Now let’s say you’ve created a build process. You also create a test process. Now — you’d like to run the build and the tests for 3 browsers — chrome, firefox and Safari. The catch? Safari runs only on MacOS. Darn…
So… you spin up 3 MacOS machines. You notice 2 things:
- MacOS machines are much slower and also their internet connection is much slower
- MacOS machines are much more expensive and your devops ppl (or your finance team) are sending you nice (or rather polite) emails about over-quota (real story).
In addition, you need the test coverage only from the chrome run.
I think you got the gist of it — it can be complex.
So… you create 3 different jobs — one for each browser. Lots of code, not nice (you don’t really have to read the code — just get that it is long and not “nice”):