GitHub Actions
GitHub Actions is a service that allows you to run automated workflows in response to events that are triggered in GitHub. You can use GitHub Actions to automate tasks such as building, testing, and deploying your code.
This guide will show you how to use GitHub Actions to create and test on your AVH devices.
Prerequisites
To use GitHub Actions with AVH, you will need:
- An AVH account
- A GitHub account
- An AVH API token
- A GitHub repository
Create an AVH API token
To use GitHub Actions with AVH, you will need to create an AVH API token, which you can do in our Web UI.
Create a GitHub repository
To use GitHub Actions with AVH, you will need to create a GitHub repository. You can do this by following the instructions on GitHub.
Add your environment secrets
To use GitHub Actions with AVH, you will need to add your AVH API token and Project ID to your GitHub repository's environment secrets.
To do this, go to your GitHub repository's settings and add the following environment secrets:
CORELLIUM_API_TOKEN
: Your AVH API tokenCORELLIUM_PROJECT
: Your AVH project ID
Create a GitHub Actions workflow
To use GitHub Actions with AVH, you will need to create a GitHub Actions workflow. You can do this by creating a file called .github/workflows/corellium.yml
in your GitHub repository.
The following example workflow will run the following steps every push:
- Create a device (an Android running 14.0.0)
- Show the installed apps
- List the device's files
- Stop the device
- Delete the device
Let's go!
name: AVH
on: [push]
jobs:
corellium:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install AVH CLI
run: npm install -g @corellium/corellium-cli
- name: Login to AVH
run: corellium login --apitoken ${{ secrets.CORELLIUM_API_TOKEN }} --endpoint https://app.avh.corellium.com
- name: Create device
# The `true` argument will wait for the device to be ready before continuing, which is useful for CI.
# We'll store the device ID in an environment variable so we can use it later.
run: |
id=$(corellium instance create ranchu 14.0.0 ${{ secrets.CORELLIUM_PROJECT }} true)
echo "instanceId=$id" >> $GITHUB_ENV
- name: List apps
# This may take a few minutes to finish as the device restores.
run: corellium agent apps --project ${{ secrets.CORELLIUM_PROJECT }} --instance ${{ env.instanceId }}
- name: List files
run: corellium agent files --project ${{ secrets.CORELLIUM_PROJECT }} --instance ${{ env.instanceId }}
- name: Stop device
# The `true` argument will wait for the device to be fully stopped before continuing, which is useful for CI.
run: corellium instance stop ${{ env.instanceId }} true
- name: Delete device
run: corellium instance delete ${{ env.instanceId }}