Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Run Newman using GitHub Actions #20

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/newman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test-Build
on:
push:
branches:
- *
jobs:
test-api:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# INstall Node on the runner
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: '12.x'

# Install the newman command line utility and also install the html extra reporter
- name: Install newman
run: |
npm install -g newman
npm install -g newman-reporter-htmlextra

# Make directory to upload the test results
- name: Make Directory for results
run: mkdir -p testResults


# Run the POSTMAN collection
- name: Run POSTMAN collection
run: |
newman run ./tests/pokemon-api-collection.json -e ./tests/pokemonapi-env.json -r htmlextra --reporter-htmlextra-export testResults/htmlreport.html --reporter-htmlextra-darkTheme > testResults/runreport1.html

# Upload the contents of Test Results directory to workspace
- name: Output the run Details
uses: actions/upload-artifact@v2
with:
name: RunReports
path: testResults