Skip to content

Report in GitHub Actions ​

Use this procedure to show each Hurl request as a test in the summary of a GitHub Actions job.

Procedure ​

  1. Add a workflow file, for example .github/workflows/api-tests.yml:

    yaml
    name: API tests
    
    on: [push, pull_request]
    
    jobs:
      api:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v5
          - uses: gacts/install-hurl@v1
          - uses: actions/setup-python@v6
            with:
              python-version: "3.12"
          - run: pip install hurl-orchestra
          - name: Run the tests
            run: hurl-orchestra ./tests --report-ctrf results.json
          - name: Publish the test report
            if: always()
            uses: ctrf-io/github-test-reporter@v1
            with:
              report-path: tests/results.json
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  2. Keep if: always() on the report step. Without it, the step does not run after a failure.

  3. Set report-path to the directory that you gave to hurl-orchestra and the file name. A relative --report-ctrf path goes into that directory.

  4. Push the change and open the summary of the workflow run.

Result ​

The GitHub test reporter shows the passed, failed and skipped tests. A known failure shows as a flaky test with its name as a tag.

Keep the Hurl reports ​

To keep the zip file, add a step after the tests:

yaml
- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: hurl-reports
    path: tests/report.zip