2121
2222jobs :
2323
24- BUILD :
24+ BUILD_AND_REPORT :
2525 runs-on : ${{ inputs.runs_on }}
2626 outputs :
2727 status : ${{ steps.build.outputs.status }}
@@ -71,11 +71,16 @@ jobs:
7171 aws s3 cp dist/*.whl s3://nm-github-actions/${{ github.event.repository.name }}/
7272 if [ $? -eq 0 ]; then
7373 echo "ok: copied to s3://nm-github-actions/${{ github.event.repository.name }}/"
74- echo "status=success" >> "$GITHUB_OUTPUT"
7574 else
7675 echo "failed: copied to s3://nm-github-actions/${{ github.event.repository.name }}/"
76+ exitCode=1
77+ fi
78+ if [ ${exitCode} -eq 1 ]; then
7779 echo "status=failed" >> "$GITHUB_OUTPUT"
78- exit 1
80+ cp .github/workflows/result.xml.fail result.xml
81+ else
82+ echo "status=success" >> "$GITHUB_OUTPUT"
83+ cp .github/workflows/result.xml.success result.xml
7984 fi
8085 oldDate=`date --date='-2 month' +%Y%m%d`
8186 oldWhl=`(aws s3 ls s3://nm-github-actions/${{ github.event.repository.name }}/ | grep nightly | grep "${oldDate}") || echo "notfound"`
@@ -86,40 +91,27 @@ jobs:
8691 aws s3 rm s3://nm-github-actions/${{ github.event.repository.name }}/${oldwhl}
8792 done
8893 fi
89-
90- TESTMO :
91- if : success() || failure()
92- needs : BUILD
93- runs-on : ${{ inputs.runs_on }}
94- steps :
95-
96- - id : report
97- run : |
98- echo "node: $(node -v)"
99- echo "npm: $(npm -v)"
100- echo "Installing testmo cli..."
101- sudo npm install -g @testmo/testmo-cli
102- export TESTMO_TOKEN=${{ secrets.TESTMO_TEST_TOKEN }}
103- TESTMO_URL="https://neuralmagic.testmo.net"
104- todaytime=`date +%Y%m%d`
105- name="${{ github.event.repository.name }} ${{ inputs.build_type }} ${todaytime} ${{ needs.BUILD.outputs.commitid }} RunID:${{ inputs.run_id }}"
106- echo "========== Build info ==========="
107- echo "name: ${name}"
108- echo "build status: ${{ needs.BUILD.outputs.status }}"
109- echo "<status>${{ needs.BUILD.outputs.status }}</status>" > result.xml
110- exit_code=1
111- if [[ "${{ needs.BUILD.outputs.status }}" = "success" ]]; then
112- exit_code=0
113- fi
114- echo "echo \"GHA job ${{ needs.BUILD.outputs.status }}: https://github.com/neuralmagic/${{ github.event.repository.name }}/actions/runs/${{ inputs.run_id }}\"; exit ${exit_code}" > result.sh
115- echo "========== Report to testmo ==========="
116- echo "testmo automation:run:submit \\"
117- echo " --instance ${TESTMO_URL} \\"
118- echo " --project-id ${{ inputs.testmo_project_id }} \\"
119- echo " --name ${name} \\"
120- echo " --source ${{ github.event.repository.name }} \\"
121- echo " --results result.xml"
122- testmo automation:run:submit \
94+ # TESTMO
95+ echo "node: $(node -v)"
96+ echo "npm: $(npm -v)"
97+ echo "Installing testmo cli..."
98+ sudo npm install -g @testmo/testmo-cli
99+ export TESTMO_TOKEN=${{ secrets.TESTMO_TEST_TOKEN }}
100+ TESTMO_URL="https://neuralmagic.testmo.net"
101+ todaytime=`date +%Y%m%d`
102+ name="${{ github.event.repository.name }} ${{ inputs.build_type }} ${todaytime} ${GITHUB_SHA:0:7} RunID:${{ inputs.run_id }}"
103+ echo "========== Build info ==========="
104+ echo "name: ${name}"
105+ echo "build: $GITHUB_OUTPUT"
106+ echo "echo \"GHA job $GITHUB_OUTPUT: https://github.com/neuralmagic/${{ github.event.repository.name }}/actions/runs/${{ inputs.run_id }}\"; exit ${exitCode}" > result.sh
107+ echo "========== Report to testmo ==========="
108+ echo "testmo automation:run:submit \\"
109+ echo " --instance ${TESTMO_URL} \\"
110+ echo " --project-id ${{ inputs.testmo_project_id }} \\"
111+ echo " --name ${name} \\"
112+ echo " --source ${{ github.event.repository.name }} \\"
113+ echo " --results result.xml"
114+ testmo automation:run:submit \
123115 --instance "${TESTMO_URL}" \
124116 --project-id ${{ inputs.testmo_project_id }} \
125117 --name "${name}" \
0 commit comments