Skip to main content
← Back to workflows

How to Run Flank with GitHub Action

Flank/flank -
GitHub Action
Flank v23.10.1
GitHub Org's stars
Contributors
Categories
CICube banner
The GitHub Actions dashboard helps you spot bottlenecks and optimize your CI pipeline with actionable insights.
Usage
name: Run Flank
on:
push:
branches:
- main

jobs:
run_flank:
runs-on: ubuntu-latest
name: Run Flank Android Tests
steps:
- uses: actions/checkout@v4

- uses: Flank/flank@master
id: flank_run
with:
version: v21.03.1
service_account: ${{ secrets.SERVICE_ACCOUNT }}
platform: android
flank_configuration_file: './testing/android/flank-simple-success.yml'

- name: Output Results
run: |
echo "Local directory: ${{ steps.flank_run.outputs.local_results_directory }}"
echo "Gcloud results: ${{ steps.flank_run.outputs.gcloud_results_directory }}"

flank-action logo

Run Flank

A GitHub Action to run Flank for Android and iOS testing.


What is Flank GitHub Action?

This GitHub Action allows you to run Flank in a GitHub workflow to manage Android and iOS testing efficiently. Flank executes tests using Google Cloud Test Lab, providing scalable test execution.

How to Specify the Flank Version

You can choose a specific Flank version by using the version input. If not specified, it will default to the latest available version.

with:
version: v21.03.1 # or leave it blank for the latest version

How to Authenticate with a Service Account

The service_account input is used to authenticate with Google Cloud. You can pass the path to the service account file, link to the file, or the file content itself. It is recommended to store sensitive data like service account files in GitHub Secrets.

with:
service_account: ${{ secrets.SERVICE_ACCOUNT }} # Store service account in GitHub secrets

How to Select the Platform

Flank supports both Android and iOS platforms. You can specify which platform to run tests on by using the platform input.

with:
platform: android # Can be 'android' or 'ios'

How to Provide a Flank Configuration File

The flank_configuration_file input is mandatory and should point to the configuration file that defines your testing setup. The file path must be relative to the root of your repository.

with:
flank_configuration_file: './testing/android/flank-simple-success.yml'

Example Workflow with Service Account from Secrets

- name: flank run
id: flank_run
uses: Flank/flank@master
with:
version: v21.03.1
service_account: ${{ secrets.SERVICE_ACCOUNT }}
platform: android
flank_configuration_file: './testing/android/flank-simple-success.yml'

Example Workflow with Service Account from Repository

- name: flank run
id: flank_run
uses: Flank/flank@master
with:
service_account: './service_account.json'
platform: android
flank_configuration_file: './testing/android/flank-simple-success.yml'

Example Workflow with Service Account Creation

- name: Create service account
run: echo '${{ secrets.SERVICE_ACCOUNT }}' > service_account_created.json

- name: flank run
id: flank_run
uses: Flank/flank@master
with:
service_account: './service_account_created.json'
platform: android
flank_configuration_file: './testing/android/flank-simple-success.yml'

Flank Outputs

  • gcloud_results_directory: This output gives a link to the Google Cloud storage location where the test results are stored.
  • local_results_directory: This is the local directory path where all the output files from the Flank run are stored.

Monitoring GitHub Actions Workflows

CICube is a GitHub Actions monitoring tool that provides you with detailed insights into your workflows to further optimize your CI/CD pipeline. With CICube, you will be able to track your workflow runs, understand where the bottlenecks are, and tease out the best from your build times. Go to cicube.io now and create a free account to better optimize your GitHub Actions workflows!

CICube GitHub Actions Workflow Duration Monitoring