GitHub
GitHub provides a comprehensive CI/CD tool that enables automated testing and deployment processes for software development projects. With GitHub Actions, developers can create workflows to build, test, and deploy code directly within their repositories.
In this document, you will learn how to integrate AgileTest with Github CI/CD tool.
Firstly, you need to acquire Client id and Client secret from AgileTest. Please refer to this document for more details Access API documentation.
Make sure your account has permission to create TestCase and TestExecution issues; otherwise, the import will fail.
Setup with Github
Go to your Github repository → Settings → Secrets and variables. On Secrets tab, add 2 secrets named CLIENT_ID and CLIENT_SECRET and assign them with the values of client id and client secret which you have acquired from AgileTest.

Action secrets
Similarly, on Variables tab, add one and name it PROJECT_KEY. This variable would be used to indicate which project AgileTest will create the new Test execution into.

Action variables
Upload test result
Here is a JUnit report example to experiment with.
If you need more thorough examples, please refer to our public repository for more sample projects Agile Test GitHub.
🔥 Since GitHub masks all tokens stored in secret variables, you'll need to use the AgileTest CLI to upload the test results.
You could find the specs of our CLI here https://agiletestapp.github.io/agiletest-cli/ .
Below is a sample yaml file.
name: Agile Test Demo
# This workflow represents a set of basic End-to-End tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
PROJECT_KEY: ${{ vars.PROJECT_KEY }}
jobs:
test:
name: run test
runs-on: ubuntu-latest
container: maven:3.9.9-amazoncorretto-17-al2023
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run test
run: mvn test
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: testResult
path: target/surefire-reports/*.xml
upload-result:
name: upload report
needs: test
runs-on: ubuntu-latest
container: ghcr.io/agiletestapp/agiletest-cli:latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: testResult
- name: Upload report
run: |
agiletest --client-id ${CLIENT_ID} --client-secret ${CLIENT_SECRET} \
test-execution import \
--framework-type junit --project-key ${PROJECT_KEY} \
TEST-calculateTest.xml
In this workflow yaml file, we have 2 jobs named test and upload-result.
In test job, we run the automation test scripts and the process yields the reports. Then the report is uploaded to Github artifact using upload-artifact action.
Next, in upload-result job, we use Agile Test CLI, which is integrated in a docker image, to upload the test result to Agile Test application.
Firstly, Github workflow downloads the files you have uploaded in the previous stage by calling download-artifact action.
Next, we use below command to upload test results and create Test cases along with test statuses and relevant attachments.
agiletest --client-id ${CLIENT_ID} --client-secret ${CLIENT_SECRET} \
test-execution import \
--framework-type junit --project-key ${PROJECT_KEY} \
TEST-calculateTest.xml
For each test run, a new Test Execution will be created along with linked Test Cases. However, if the Test Cases already exist in your project, Agile Test will only generate a new Test Execution and link the matching Test Cases to it, including the test results
Should you need any assistance or further AgileTest inquiries, contact here!