GitHub Actions help you to automate tasks within your software development life cycle. They are event-driven, meaning that you can run a series of commands after a specified event has occurred. For example, every time someone commits a push or creates a pull request for a repository branch, you can automatically trigger a job that executes automated build and run scripts on Arm Virtual Hardware. Refer to Introduction to GitHub Actions for information about the components of GitHub Actions.
GitHub Actions workflow executes your commands on a Virtual Machine (GitHub Runner) that is hosted either directly by GitHub or can be self-hosted. The descriptions below refer to using GitHub-hosted Runner as a simpler way to get started with GitHub Actions.
Integration of Arm Virtual Hardware into GitHub Actions is enabled with AVH Client - a python module that manages remote connection, upload, build, and execution of programs on AVH AMI instances. The figure below shows a concept for a simple GitHub Action workflow that builds and tests a program on Arm Virtual Hardware.
The workflow has three main steps:
Sections below explain implementation of corresponding GitHub Action in details:
Examples
GitHub Actions workflow is implemented in most AVH reference examples. If you are not well familiar with GitHub Actions, it is recommended to start with AVH-GetStarted example that explains the CI implementation in details.
The requirements to the AWS infrastructure are determined by the use of AVH Client with AWS backend. See AWS backend setup in AVH Client description. CloudFormation template provides a simple way to get the necessary resources setup in AWS.
The AWS parameters obtained in this step can be then stored as GitHub Secrets and provided to the GitHub Runner environment in GitHub Actions workflow.
GitHub Actions workflows get implemented in .github/workflows/<workflowFileName>.yml
files in the GitHub project repository. See GitHub tutorial Using workflows for full details.
The workflow for running a job on AVH AMI would typically be constructed as follows:
execute
command with AWS backend. A .yml specfile shall be provided to the command, specifying the actions to be executed on AVH AMI. See Define AVH Actions.Repository-specific GitHub Secrets provide a useful mechanism that can be used for secure storage of sensitive AWS parameters required for running AVH Client.
The AWS environment parameters required for AVH Client are explained in AWS backend setup and can be can be assigned to the repository secrets without exposing their values as shown in Add GitHub Actions workflow.
To create GitHub Secrets:
Note that when repository is forked, its secrets are not copied and need to be added to the forked repository again.
Find more information in GitHub documentation: Creating encrypted secrets for a repository.
AVH Actions are the commands that get executed on the AVH AMI with AVH Client. They need to be described in a YAML specfile provided to the avhclient execute
command. Typically the file would specify additional AWS parameters, list project files to be uploaded to the AVH AMI, describe commands to be executed, and list the files to be retrieved back. The file format is explained in AVH YML file.
Using AVH Client in a GitHub Actions workflow does not put additionally any specific requirements to the AVH Client specfile.
Once the GitHub Actions workflow is present in .github/workflows/
directory, it will be triggered on the events defined in Add GitHub Actions workflow.
The details of the specific workflow run can be observed on the GitHub repository page under Actions. Find more information in GitHub documentation: Viewing the activity for a workflow run.
For example for the AVH-GetStarted project: