Skip to Content
CLICI/CD Integration

CI/CD Integration

The Thunder Client CLI can run collections on build servers and save reports in XML, HTML, JSON, and CSV formats.

  1. VS Code Settings: If you use any Thunder Client settings in VS Code, set their scope to workspace so they are saved in the workspace directory.
  2. Git Sync: Running collections on a build server requires the Git Sync feature to be enabled.
  3. Reports: The tc --col "ColNameOrId" --report "xml,html" command executes all requests and saves the reports to the thunder-reports folder.

Video Walkthrough

Video guideCollection Runner in CI/CDYouTube

GitHub Actions

  • Use the sample YAML file to integrate with GitHub Actions or other build pipelines.

Workspace Location

  • (Optional) The CLI uses the current working directory as the workspace. If your data is in a different directory, specify it with --ws 'fullpathToGitWorkspace'.

Stop Collection on Failure

  • (Optional) To stop running the remaining requests when a test fails, use the --stop-on-fail argument.

Sample YAML File

main.yaml
# This is a basic workflow to help you get started with Actions name: TestBuild # Controls when the workflow will run on: # Triggers the workflow on push or pull request events, but only for the "main" branch # push: # branches: [ "main" ] # pull_request: # branches: [ "main" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 # Install Node on the runner - name: Install Node uses: actions/setup-node@v4 with: node-version: 22 # Install Thunder Client CLI - name: Install Thunder Client CLI run: | npm install -g @thunderclient/cli - name: Create reports directory run: mkdir -p thunder-reports # Run the Thunder Client collection - name: Run Thunder Client collection run: | tc --col "ColNameOrId" --report cli,json,xml,html --log 8 # Upload the reports directory as a workflow artifact - name: Upload run reports if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: RunReports path: thunder-reports
Last updated on