API Test and Status Update #9166
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: API Test and Status Update | |
on: | |
schedule: | |
- cron: "*/15 * * * *" | |
workflow_dispatch: | |
jobs: | |
run-newman-tests: | |
if: github.event.repository.fork == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Newman | |
run: npm install -g newman | |
- name: Run Newman Tests here | |
run: newman run qa_tests/regression/Spartacus_Java_Boilerplate_Copy.postman_collection.json -r json --reporter-json-export=result.json --suppress-exit-code | |
continue-on-error: true | |
- 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" | |
source: "result.json" | |
target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web/" | |
# 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 | |