GPT Driver User Guide
GPT Driver API
GPT Driver API
  • Welcome
  • Basics
    • Upload builds
      • Web UI
      • API
      • CI/CD Examples
        • Github Actions
        • Bitrise
        • GitLab CI
        • CodeMagic
        • Jenkins
        • Circle CI
    • Trigger tests
      • Web UI
      • API
      • API Examples
      • Physical-Device Examples
  • MORE
    • Webhooks
    • Screenshots
    • Meta Data
    • App launch parameters
    • Run existing Appium tests
    • Github Action Step Script
Powered by GitBook
On this page
  1. MORE

Github Action Step Script

To use GPT Driver as part of your Github Action pipeline, we offer a Bash script which is designed to automate the process of uploading mobile application builds to the GPTDriver API and executing a series of tests. Intended for integration as a GitHub Actions step, the script manages the entire test lifecycle, including build upload, test execution, status monitoring, and result handling.

Usage The script requires two positional parameters: the path to the build file and the platform designation (e.g., android, ios). These parameters, along with necessary environment variables (API_ORG_KEY, API_TOKEN, TEST_TAGS), should be set in the GitHub Actions workflow as shown below:

name: Run Tests on Pull Requests

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2
      - name: Run GPTDriver tests
        run: curl https://app.mobileboost.io/cli.sh | bash ${{ github.workspace }}/path_to_your_build.apk android
        env:
          API_ORG_KEY: ${{ secrets.API_ORG_KEY }}
          API_TOKEN: ${{ secrets.API_TOKEN }}
          TEST_TAGS: ready,...

Integration To integrate this script into a GitHub Actions workflow, ensure the necessary environment variables are configured as secrets in your GitHub repository. The script is executed directly within a run step. This setup is ideal for automated testing scenarios in mobile application development pipelines.

Key Features

  • Secure Configuration: Utilizes environment variables for sensitive data such as API keys and tokens, ensuring secure operations without hard-coding sensitive information.

  • Dynamic Tagging: Supports the inclusion of tags from the TEST_TAGS environment variable, allowing for flexible test categorization and execution scenarios. TEST_TAGS is optional and when provided should be a comma separated list.

  • Test Results: The script outputs the status of the test suite and writes a detailed summary to the GITHUB_STEP_SUMMARY file if available. By default the script exits with a status code of 0 in case all tests succeed; otherwise, it exits with a status code of 1, indicating at least one failed test in the test suite.

PreviousRun existing Appium tests

Last updated 6 days ago