• Home
  • Public Speaking
  • Travel

Test automation is an important part of continuous testing. They can be executed automatically on the pipelines in terms of regression testing or other verification activities. Github Actions is one of those continuous integration and continuous delivery (CI/CD) platforms that allows you to automate your build, test, and deployment pipeline. Let's have a quick overview of how it works.
(for detailed info, please visit Github Official Documentation)

Basics

In Github Actions, we can create workflows to run our jobs. They can be implemented via yaml files. In the yaml file, basically the trigger and jobs to be executed should be declared. After the workflow is pushed to the repository, they can be seen in the Github repository UI.

Triggers

Firstly, it should be clarified that when the jobs defined in the current yaml are triggered. There are several events triggerring workflows such as:

Manually : This workflow can be executed by manually starting from the UI.
Scheduled : This workflow can be started automatically by scheduling periodically. They can run hourly, nightly or with any custom frequency, defined by cron expressions.
On Push : This workflow can start after any commit is pushed to the branches in the repo.
Workflow Call : This workflow can be called by another workflow. In this way, reusable workflows can be created.

Formation of triggers can be seen in the image below.




Jobs

After defining when/under what condition the workflow starts, next step is defining job to run. Each job runs on a virtual machine and perform one or more action steps. Steps can wither run an executable or call a published Docker container image. A sample job including a step using docker image and a step running a script can be seen in the image below.




Workflow Parameters

Some environmental variables can be set from the workflows. They can be collected from the user over the UI just before starting the jobs. In this way, dynamically generated variables pawe the way for reducing suplication. A sample usage is shown below.




Using Matrix

A very nice feature of the workflow jobs is iterating over a list of parameters. In this way, we can cover a bunch of configuration settings.




If you are using Cypress, this is the way to run tests parallelly.