GitHub CI

What is GitHub?

GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

CI/CD Workflows


a. Connect your Workflow

Follow these steps to connect a GitHub workflow to Qase:

  1. One of Qase reporter apps should be used in order to receive the test run results.

  2. Create a token in Qase and add it to the QASE_API_TOKEN secret in your GitHub repository settings.

  1. The inputs and env variables that are required need to be defined in a workflow:

name: Qase Tests
on:
  workflow_dispatch:
    inputs:
      qase_api_base_url:
        description: "Qase API URL"
        required: true
      qase_report:
        description: "Enabled/disabled reporting to Qase"
        required: true
      qase_project_code:
        description: "Qase project code"
        required: true
      qase_run_id:
        description: "Qase Run ID"
        required: true
      qase_run_complete:
        description: "Qase Run autocomplete"
        required: true

env:
  QASE_API_BASE_URL: ${{ inputs.qase_api_base_url }}
  QASE_TESTOPS_PROJECT: ${{ inputs.qase_project_code }}
  QASE_TESTOPS_RUN_ID: ${{ inputs.qase_run_id }}
  QASE_TESTOPS_RUN_COMPLETE: true
  QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
  1. Add a step to the first place in the job. It allows to link a GitHub workflow run with a Qase test run.

jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
      - uses: cskmnrpt/qase-link-run@v2
        env:
          QASE_TESTOPS_API_TOKEN: ${{ env.QASE_TESTOPS_API_TOKEN }}
  1. Add additional steps to execute your tests.

b. Start an automated run

After the workflow is connected, you can initiate automated test runs from Qase:

  1. From the Test runs screen, click "Start a new Test run", and choose the type as 'Automated'

  1. Choose a CI/CD system to use (Github):

  1. Fill in the required fields:

  1. Click "Start a run" button.

  2. You will be redirected to a test run you started. In the test run details section, you will see a link to the workflow run in GitHub and the current status.

  1. When the tests have been executed, the test run will contain all the results sent by a reporter (it should be properly configured):

GitHub Actions

GitHub Actions allows for reusable functions and workflows, enhancing automation and efficiency.

Qase offers the following actions, which can be integrated into your workflows to streamline tasks.

Troubleshooting:

If integration with GitHub has already been enabled before, it’s required to accept new permissions in the GitHub application settings.

In case of insufficient permissions after clicking on the “Start a run” button, a message with an error will appear.

Useful resource

An example of Github integration: https://github.com/qase-tms/qase-javascript/tree/master/examples/github-qase-integration

Last updated