Sample repository for demonstrating how to run Postman Collections with Newman in a CI/CD pipeline using GitHub Actions.
- π§ͺ Latest Test Report β https://rmgoede.github.io/qa-apis-postman-sample/report.html
- βοΈ Workflow Runs β https://github.com/rmgoede/qa-apis-postman-sample/actions
- π Duration Trend β https://rmgoede.github.io/qa-apis-postman-sample/trend.html
- π¦ Collection JSON β /postman/Postman Library API V2.postman_collection.json
This repository shows how to:
- Store and version Postman collections in GitHub.
- Automatically run API tests via Newman on every commit.
- Generate HTML & JUnit reports.
- Publish the HTML report to GitHub Pages for easy sharing.
The workflow (.github/workflows/postman-ci.yml) does the following:
- Trigger: Runs on every push or pull request to
mainthat changes Postman collections or workflow config. - Run Tests:
- Installs Newman + reporters
- Executes the Postman collection with CLI + HTML + JUnit reporters
- Artifacts:
- Uploads the
newmanfolder as a downloadable build artifact - Prepares the HTML report for deployment
- Uploads the
- Deployment:
- Publishes the latest HTML report to GitHub Pages
π Example Workflow Snippet:
name: API Tests
on:
push:
branches: [ "main" ]
jobs:
newman:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Newman tests
run: newman run postman/Postman\ Library\ API\ V2.postman_collection.json# Install Newman
npm install -g newman newman-reporter-htmlextra
# Run the collection with HTML report
newman run "postman/Postman Library API V2.postman_collection.json" \
-r htmlextra --reporter-htmlextra-export ./local-report.html- Latest HTML Report: π View Report
- Artifacts (per workflow run):
report.html(HTML dashboard)results.xml(JUnit format, CI-friendly)
πΈ Example Report Screenshot (click to open the live report):
