Skip to content

Commit

Permalink
Update postman-api-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
stephennwachukwu authored Aug 26, 2024
1 parent 82cc4a5 commit a5a503c
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/postman-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,38 @@ jobs:
run: npm install -g newman

- name: Run Postman Collection with HTML Reporter
run: newman run postman-api-tests.json -r cli, json --reporter-json-export result.json
# run: newman run postman-api-tests.json -r cli, json --reporter-json-export result.json
run: newman run qa_tests/Spartacus_Java_Boilerplate_Copy.postman_collection.json -r json --reporter-json-export=result.json --suppress-exit-code
continue-on-error: true

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'

- name: Send parsed result to Hosted Application
run: |
export APP_URL=${{ secrets.APP_URL }}
java -jar sendPostmanApiTestResults.jar newman-report.html result.json
- name: Copy newman-report.html to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "newman-report.html"
target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web"
# source: "newman-report.html"
source: "result.json"
target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web/staging-result"

# - name: Set up Java
# uses: actions/setup-java@v3
# with:
# distribution: 'adopt'
# java-version: '17'

# - name: Send parsed result to Hosted Application
# run: |
# export APP_URL=${{ secrets.APP_URL }}
# java -jar sendPostmanApiTestResults.jar newman-report.html result.json
- name: Deploy to Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd hng_boilerplate_java_web/staging-result
java -jar sendPostmanApiTestResults.jar

0 comments on commit a5a503c

Please sign in to comment.