From feabf4d9d18eea9bdb00c7754a8b1abdbd7e2b1a Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Fri, 14 Feb 2020 18:08:33 -0800 Subject: [PATCH] imrpve more stuff --- .github/workflows/main.yml | 88 +++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5401d1cd8..c964f34bd6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "Docker_Ubuntu_16_04" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 @@ -32,7 +32,7 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "unit_test" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 @@ -58,12 +58,12 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "Docker_Ubuntu_16_04" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" runs-on: ubuntu-16.04 steps: - name: Install gopogh run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.14/gopogh-linux-amd64 + curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64 sudo install gopogh-linux-amd64 /usr/local/bin/gopogh - name: Download binaries uses: actions/download-artifact@v1 @@ -94,12 +94,16 @@ jobs: go tool test2json -t < ./report/testout.txt > ./report/testout.json || true STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name " $GITHUB_REF" -repo "${JOB_NAME} ${GITHUB_REF} ${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true echo status: ${STAT} - COMMIT_STATUS="${JOB_NAME} : Completed with ${STAT} in ${TIME_ELAPSED}" - echo ::set-env name=COMMIT_STATUS::${COMMIT_STATUS} + FailNum=$(echo $STAT | jq '.NumberOfFail') + TestsNum=$(echo $STAT | jq '.NumberOfTests') + GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}" + echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT} + echo ::set-env name=STAT::${STAT} - name: The End Result run: | - echo time elapsed is ${TIME_ELAPSED} - echo END RESULT IS ${COMMIT_STATUS} + echo ${GOPOGH_RESULT} + echo "" + echo $STAT | jq '.FailedTests' || true - uses: actions/upload-artifact@v1 with: name: docker_ubuntu_16_04 @@ -109,12 +113,12 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "Docker_Ubuntu_18_04" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" needs: [build_minikube] steps: - name: Install gopogh run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.14/gopogh-linux-amd64 + curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64 sudo install gopogh-linux-amd64 /usr/local/bin/gopogh - name: Download binaries uses: actions/download-artifact@v1 @@ -145,12 +149,16 @@ jobs: go tool test2json -t < ./report/testout.txt > ./report/testout.json || true STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name " $GITHUB_REF" -repo "${JOB_NAME} ${GITHUB_REF} ${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true echo status: ${STAT} - COMMIT_STATUS="${JOB_NAME} : Completed with ${STAT} in ${TIME_ELAPSED}" - echo ::set-env name=COMMIT_STATUS::${COMMIT_STATUS} + FailNum=$(echo $STAT | jq '.NumberOfFail') + TestsNum=$(echo $STAT | jq '.NumberOfTests') + GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}" + echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT} + echo ::set-env name=STAT::${STAT} - name: The End Result run: | - echo time elapsed is ${TIME_ELAPSED} - echo END RESULT IS ${COMMIT_STATUS} + echo ${GOPOGH_RESULT} + echo "" + echo $STAT | jq '.FailedTests' || true - uses: actions/upload-artifact@v1 with: name: docker_ubuntu_18_04 @@ -160,12 +168,12 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "None_Ubuntu_16_04" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" runs-on: ubuntu-16.04 steps: - name: Install gopogh run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.14/gopogh-linux-amd64 + curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64 sudo install gopogh-linux-amd64 /usr/local/bin/gopogh - name: Download binaries uses: actions/download-artifact@v1 @@ -196,12 +204,16 @@ jobs: go tool test2json -t < ./report/testout.txt > ./report/testout.json || true STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name " $GITHUB_REF" -repo "${JOB_NAME} ${GITHUB_REF} ${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true echo status: ${STAT} - COMMIT_STATUS="${JOB_NAME} : Completed with ${STAT} in ${TIME_ELAPSED}" - echo ::set-env name=COMMIT_STATUS::${COMMIT_STATUS} + FailNum=$(echo $STAT | jq '.NumberOfFail') + TestsNum=$(echo $STAT | jq '.NumberOfTests') + GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}" + echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT} + echo ::set-env name=STAT::${STAT} - name: The End Result run: | - echo time elapsed is ${TIME_ELAPSED} - echo END RESULT IS ${COMMIT_STATUS} + echo ${GOPOGH_RESULT} + echo "" + echo $STAT | jq '.FailedTests' || true - uses: actions/upload-artifact@v1 with: name: none_ubuntu16_04 @@ -211,12 +223,12 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "None_Ubuntu_18_04" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" runs-on: ubuntu-18.04 steps: - name: Install gopogh run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.14/gopogh-linux-amd64 + curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64 sudo install gopogh-linux-amd64 /usr/local/bin/gopogh - name: Download binaries uses: actions/download-artifact@v1 @@ -247,12 +259,16 @@ jobs: go tool test2json -t < ./report/testout.txt > ./report/testout.json || true STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name " $GITHUB_REF" -repo "${JOB_NAME} ${GITHUB_REF} ${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true echo status: ${STAT} - COMMIT_STATUS="${JOB_NAME} : Completed with ${STAT} in ${TIME_ELAPSED}" - echo ::set-env name=COMMIT_STATUS::${COMMIT_STATUS} + FailNum=$(echo $STAT | jq '.NumberOfFail') + TestsNum=$(echo $STAT | jq '.NumberOfTests') + GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}" + echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT} + echo ::set-env name=STAT::${STAT} - name: The End Result run: | - echo time elapsed is ${TIME_ELAPSED} - echo END RESULT IS ${COMMIT_STATUS} + echo ${GOPOGH_RESULT} + echo "" + echo $STAT | jq '.FailedTests' || true - uses: actions/upload-artifact@v1 with: name: none_ubuntu18_04 @@ -262,7 +278,7 @@ jobs: env: TIME_ELAPSED: time JOB_NAME: "Podman_Ubuntu_18_04" - COMMIT_STATUS: "" + GOPOGH_RESULT: "" runs-on: ubuntu-18.04 steps: - name: install podman @@ -277,7 +293,7 @@ jobs: sudo podman info || true - name: Install gopogh run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.14/gopogh-linux-amd64 + curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64 sudo install gopogh-linux-amd64 /usr/local/bin/gopogh - name: Download binaries uses: actions/download-artifact@v1 @@ -306,14 +322,18 @@ jobs: cd minikube_binaries export PATH=${PATH}:`go env GOPATH`/bin go tool test2json -t < ./report/testout.txt > ./report/testout.json || true - STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name " $GITHUB_REF" -repo "${JOB_NAME} ${GITHUB_REF} ${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true echo status: ${STAT} - COMMIT_STATUS="${JOB_NAME} : Completed with ${STAT} in ${TIME_ELAPSED}" - echo ::set-env name=COMMIT_STATUS::${COMMIT_STATUS} + FailNum=$(echo $STAT | jq '.NumberOfFail') + TestsNum=$(echo $STAT | jq '.NumberOfTests') + GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}" + echo ::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT} + echo ::set-env name=STAT::${STAT} - name: The End Result run: | - echo time elapsed is ${TIME_ELAPSED} - echo ${COMMIT_STATUS} + echo ${GOPOGH_RESULT} + echo "" + echo $STAT | jq '.FailedTests' || true + - uses: actions/upload-artifact@v1 with: name: podman_ubuntu_18_04 @@ -371,5 +391,5 @@ jobs: cp -r podman_ubuntu_18_04 ./all_reports/ - uses: actions/upload-artifact@v1 with: - name: all_reports_${GITHUB_REF} + name: all_reports_${{ GITHUB_REF }} path: all_reports