Travis CI
Travis CI is a service that allows you to run automated workflows in response to events that are triggered in a repository. You can use Travis CI to automate tasks such as building, testing, and deploying your code.
This guide will show you how to use Travis CI to create and test on your AVH devices.
Prerequisites
To use Travis CI with AVH, you will need:
- An AVH account
- A code repository
- An AVH API token
- A Travis CI account connected to the repository
Create an AVH API token
To use Travis CI with AVH, you will need to create an AVH API token, which you can do in our Web UI.
Create a repository
To use Travis CI with AVH, you will need to create a repository in the code repository service of your choice. For example, GitLab, GitHub, Bitbucket, etc.
Add your environment variables
To use Travis CI with AVH, you will need to add your AVH API token and Project ID to your Travis CI environment variables.
To do this, go to your repository's settings in Travis CI and add the following environment variables:
CORELLIUM_API_TOKEN
: Your AVH API tokenCORELLIUM_PROJECT
: Your AVH project ID
Create a Travis CI workflow
To use Travis CI with AVH, you will need to create a Travis CI workflow. You can do this by creating a file called .travis.yml
in your 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!
language: node_js
node_js:
- 16
before_install:
- npm install -g @corellium/corellium-cli
script:
# Login to AVH
- corellium login --apitoken ${CORELLIUM_API_TOKEN} --endpoint https://app.avh.corellium.com
# 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.
- id=$(corellium instance create ranchu 14.0.0 ${CORELLIUM_PROJECT} true)
# List apps
# This may take a few minutes to finish as the device restores.
- corellium agent apps --project ${CORELLIUM_PROJECT} --instance $id
# List files
- corellium agent files --project ${CORELLIUM_PROJECT} --instance $id
# Stop device
# The `true` argument will wait for the device to be fully stopped before continuing, which is useful for CI.
- corellium instance stop $id true
# Delete device
- corellium instance delete $id