%note add info about sending emails
%note add info about testing actions locally
GitHub Actions allow you to run code in your repository, on GitHub servers, after every push.
This can be used for many things. This article discusses how to use it for running tests (as a replacement for hosted CI services like travis.ci).
A GitHub Action is defined by a Dockerfile
in some GitHub repository. Since you can have multiple actions, you create a directory for each action.
An action is triggered by a workflow description in .github/main.workflow
file in a repository.
Workflow is specific to each repository, actions can be shared.
A workflow running time (a sum of all actions in a workflow) is limited to 1 hr.
Here's the simplest workflow:
workflow "run go test on push" {
on = "push"
resolves = ["test"]
}
action "test" {
uses = "kjk/siser/action-go-test@master"
}
Explaining workflow
section:
run go test on push
is human-readable name of the workflow. It documents what the action is foron = "push"
says that workflow will be executed on each push (including pushes into branches)resolves = ["test"]
specifies a list of actions to execute. We just have one and it refers to action "test"
For a full list of options see documentation.
Explaining: action
section:
test
is a name by which we can refer an action from a workflowuses
specifies a location of the action