Updated YML file #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test-Build | |
on: push | |
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: '18.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 | |
# Run the POSTMAN collection | |
- name: Run POSTMAN collection | |
continue-on-error: true | |
run: | | |
newman run collections/petstore.collection.json -r htmlextra --reporter-htmlextra-export newman/index.html | |
# Upload the contents of Test Results directory to workspace | |
- name: Output the run Details | |
uses: actions/upload-artifact@v2 | |
with: | |
name: RunReports | |
path: newman | |
- name: Create a new branch for report | |
uses: actions/checkout@v3 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Deploy report to GitHub Pages | |
if: always() | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{secrets.GITHUB_TOKEN}} | |
publish_branch: gh-pages | |
publish_dir: newman |