Skip to content

Commit 1a79613

Browse files
committed
Add GitHub Actions workflow for running Postman API contract tests
1 parent e877186 commit 1a79613

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: API Contract Tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
run-postman-tests:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Install Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "20"
21+
22+
- name: Install Newman
23+
run: npm install -g newman newman-reporter-htmlextra
24+
25+
- name: Run Postman tests
26+
run: |
27+
newman run postman/JSONPlaceholder_Collection.json \
28+
-e postman/Development_Environment.json \
29+
-r cli,htmlextra \
30+
--reporter-htmlextra-export newman-report.html
31+
32+
- name: Upload Newman HTML Report
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: newman-report
36+
path: newman-report.html

0 commit comments

Comments
 (0)