Configuring a test run in a GitHub Actions Workflow

After you complete the prerequisite tasks to run tests in a GitHub Actions Workflow, you can configure the test run in a GitHub Actions Workflow.

Before you begin

You must have completed the tasks that are mentioned in Prerequisites to run tests in a GitHub Actions Workflow.

Procedure

  1. Perform the following steps to open the Git repository that you use or created, which has the GitHub Actions option enabled:
    1. Open the Git repository on your GitHub Enterprise server.
    2. Create a folder with the name .github/workflows in the root folder of the repository.
    3. Create an empty YAML file in the .github/workflows folder.

      The YAML file will be used to define the GitHub Action in the Actions Workflow.

  2. Perform the following steps to define the YAML file for the GitHub Action:
    1. Open the GitHub Marketplace (https://github.com/marketplace?type=) in a web browser.
    2. Search for HCL DevOps Test GUI GitHub Action to run test resources that are in a Test UI project.
    3. Open HCL DevOps Test GUI GitHub Action.
    4. Read through the information provided.
    5. Copy the contents of the YAML file that is provided in the example by clicking the copy icon Image of the copy icon..
    6. Open the YAML file that is in the .github/workflows folder of your repository and paste the copied contents.
    7. Refer to the following table to enter the required details in the YAML file:
      Field Description
      Required
      projectDirectory Enter the complete path to the location of the project containing the test. For example, D:\Projects\
      scriptName Enter the name of the test that you want to run. For example, script1.
      Optional
      iterationCount Enter the number that you want for the dataset iterations.
      logFormat Enter the format of the logs that are created when the script is run. The options are: Default, none, XML, HTML, text, and TPTP.
      userArguments Specify any arguments for the test run. For example, you can specify the playback arguments, if applicable in your test.
    8. Save the YAML file.
  3. Perform the following steps to set up a Runner for the GitHub Action in GitHub:
    1. Click the Settings icon Image of the settings icon..
    2. Click Actions > Runners > New self-hosted runner.
    3. Follow the onscreen instructions to set up a self-hosted runner on your computer.

      After the runner is installed on your computer, you must start the runner. The runner is listed in the Runners pane in the Git repository. The runner is in the Idle state when it is connected to Github and is ready to execute jobs.

      Note: You must ensure that the runner is not in the Offline state before you run a workflow.
  4. Perform the following steps to start the GitHub Action in the Workflow:
    1. Click the Actions option in the Git repository.

      The GitHub Action that you configured in the YAML file for Test UI is displayed as an Action under Workflows.

    2. Click HCL DevOps Test GUI GitHub Action, and then click Run workflow.

Results

You have configured and run a resource that is n your project on Test UI in a GitHub Action Workflow.

What to do next

You can perform any of the following tasks on the Git repository page by clicking the job that was completed:
  • View the status of the test run by expanding the Execute test section.
  • View the links to the test results and reports listed in the Execute test section.