Skip to main content

Using GitHub Actions with Corellium

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 Corellium devices.

Pre-Requisites

To use GitHub Actions with Corellium, you will need:

  • A Corellium account
  • A GitHub account
  • A Corellium API token
  • A GitHub repository

Create a Corellium API token

To use GitHub Actions with Corellium, you will need to create a Corellium API token, which you can do in our Web UI.

Create a GitHub repository

To use GitHub Actions with Corellium, 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 Corellium, you will need to add your Corellium 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 Corellium API token
  • CORELLIUM_PROJECT: Your Corellium project ID

Create a GitHub Actions workflow

To use GitHub Actions with Corellium, 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:

  1. Create a device (an iPhone 6 running iOS 12.5.6)
  2. Show the installed apps
  3. List the device's files
  4. Stop the device
  5. Delete the device

Let's go!

name: Corellium

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 Corellium CLI
run: npm install -g @corellium/corellium-cli

- name: Login to Corellium
run: corellium login --apitoken ${{ secrets.CORELLIUM_API_TOKEN }} --endpoint https://app.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 iphone6 12.5.6 ${{ 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 }}