Testing Workflows

An ActionBlocks Testing Workflow is a single main.workflow GitHub Action workflow that can would be used in other repos when adding your action.

The Testing ActionBlock will overlay a customized version of this main.workflow document on each of the testing repos locally, and then trigger the workflow to start.

For example, given an action that is normally invoked from a Pull Request events, a fictious action named “Trangam” could be:

workflow "Invoke The Trangam Action" {
  resolves = "trangam"
  on = "pull_request"
}

action "filter-to-pr-open-synced" {
  uses = "actions/bin/filter@master"
  args = "action 'opened|synchronize'"
}

action "trangam" {
  uses = "trangamhq/[email protected]"
  needs = "filter-to-pr-open-synced"
  secrets = ["GITHUB_TOKEN"]
  env = {
    ROOT_DIR = "./workdir"
  }
}

ActionBlocks will accept this document, without any changes as a workflow. When adding it, you’ll be promoted to select the specific action(s) to rewrite during test execution with the locally build container. In this example, the trangam action is most likely the action to replace, which will inmean that the uses line of that action will be rewritten to use a locally build image name when running the tests.