All Collections
Examples
API Examples
GitHub Actions Example: Building Firmware, Uploading, and Testing
GitHub Actions Example: Building Firmware, Uploading, and Testing

Setting up GitHub Actions

avhsupport avatar
Written by avhsupport
Updated over a week ago
  1. To get a VM ready for the GitHub runner, follow the steps in the Running Docker on AVH Pi article.

  2. Ensure you have an AVH API Token by following the steps in the Obtaining AVH API Token article.

  3. Create an empty GitHub repository for your runner to accept jobs from by following the steps in this GitHub Article.

  4. Add a "API_TOKEN" secret to your repository with a value of your API Token by following the steps in this GitHub Article.

  5. To configure and start the runner, follow the steps in this Adding Self Hosted Runners article. Select "Linux" as the OS and "ARM64" as the architecture.

    1. In AVH, select the Raspberry Pi VM created previously. Then select "CONSOLE" to access a shell to run the commands referenced above

    2. Upon completion of runner setup you should see something similar to:

    3. Do not cancel the running process or your runner will be unavailable until it is run again. The runner can also be installed as a service, but that is not covered in this article.

  6. Clone the avh-api repository on your usual local development system from GitHub with: git clone https://github.com/ARM-software/avh-api.git

    • NOTE that we used a raspberry pi for this in this example, this will likely be your laptop or desktop system.

  7. Enter the javascript/sensordemo-docker directory

  8. run make clean gitrepo GITREMOTE='<url to Github repo you created>' in the console.

    • NOTE: this will overwrite any contents of the repo passed as GITREMOTE=

  9. You should see an action run on your repository executed from your AVH VM

    • This will compile a new firmware for STM32u5 on the pi VM, then upload it to a new STM32 VM in Arm Virtual Hardware, and run a test against it to ensure it behaved properly.

  10. You will get a built firmware and the test results as the artifacts downloadable from GitHub when the action completes.

  11. Any changes made to the repository, such as changing how the firmware behaves and pushes to GitHub, will trigger a new run.

Did this answer your question?