Merge pull request #6645 from medyagh/gh_improve_more

make github jobs show fail if they fail
pull/6651/head
Medya Ghazizadeh 2020-02-14 22:20:22 -07:00 committed by GitHub
commit 3fad775591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 62 additions and 31 deletions

View File

@ -62,6 +62,7 @@ jobs:
runs-on: ubuntu-16.04
steps:
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
@ -88,26 +89,31 @@ jobs:
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
- name: Generate html report
shell: bash
run: |
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
STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
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 ${GOPOGH_RESULT}
echo ""
echo $STAT | jq '.FailedTests' || true
- uses: actions/upload-artifact@v1
with:
name: docker_ubuntu_16_04
path: minikube_binaries/report
- name: The End Result
shell: bash
run: |
echo ${GOPOGH_RESULT}
echo "--------------------------------------------"
echo $STAT | jq '.FailedTests' || true
echo "--------------------------------------------"
numberOfFailures=$(echo $STAT | jq '.NumberOfFail')
if [ "$numberOfFailures" -gt 0 ];then echo "*** $numberOfFailures Failed ***";exit 2;fi
docker_ubuntu_18_04:
runs-on: ubuntu-18.04
env:
@ -117,6 +123,7 @@ jobs:
needs: [build_minikube]
steps:
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
@ -143,26 +150,31 @@ jobs:
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
- name: Generate html report
shell: bash
run: |
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
STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
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 ${GOPOGH_RESULT}
echo ""
echo $STAT | jq '.FailedTests' || true
- uses: actions/upload-artifact@v1
with:
name: docker_ubuntu_18_04
path: minikube_binaries/report
- name: The End Result
shell: bash
run: |
echo ${GOPOGH_RESULT}
echo "--------------------------------------------"
echo $STAT | jq '.FailedTests' || true
echo "--------------------------------------------"
numberOfFailures=$(echo $STAT | jq '.NumberOfFail')
if [ "$numberOfFailures" -gt 0 ];then echo "*** $numberOfFailures Failed ***";exit 2;fi
none_ubuntu16_04:
needs: [build_minikube]
env:
@ -172,6 +184,7 @@ jobs:
runs-on: ubuntu-16.04
steps:
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
@ -198,26 +211,31 @@ jobs:
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
- name: Generate html report
shell: bash
run: |
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
STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
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 ${GOPOGH_RESULT}
echo ""
echo $STAT | jq '.FailedTests' || true
- uses: actions/upload-artifact@v1
with:
name: none_ubuntu16_04
path: minikube_binaries/report
- name: The End Result
shell: bash
run: |
echo ${GOPOGH_RESULT}
echo "--------------------------------------------"
echo $STAT | jq '.FailedTests' || true
echo "--------------------------------------------"
numberOfFailures=$(echo $STAT | jq '.NumberOfFail')
if [ "$numberOfFailures" -gt 0 ];then echo "*** $numberOfFailures Failed ***";exit 2;fi
none_ubuntu18_04:
needs: [build_minikube]
env:
@ -227,6 +245,7 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
@ -253,26 +272,31 @@ jobs:
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
- name: Generate html report
shell: bash
run: |
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
STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
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 ${GOPOGH_RESULT}
echo ""
echo $STAT | jq '.FailedTests' || true
- uses: actions/upload-artifact@v1
with:
name: none_ubuntu18_04
path: minikube_binaries/report
- name: The End Result
shell: bash
run: |
echo ${GOPOGH_RESULT}
echo "--------------------------------------------"
echo $STAT | jq '.FailedTests' || true
echo "--------------------------------------------"
numberOfFailures=$(echo $STAT | jq '.NumberOfFail')
if [ "$numberOfFailures" -gt 0 ];then echo "*** $numberOfFailures Failed ***";exit 2;fi
podman_ubuntu_18_04:
needs: [build_minikube]
env:
@ -282,6 +306,7 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: install podman
shell: bash
run: |
. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
@ -292,6 +317,7 @@ jobs:
sudo podman version || true
sudo podman info || true
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.1.16/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
@ -318,30 +344,35 @@ jobs:
TIME_ELAPSED="${min} min $sec seconds "
echo ::set-env name=TIME_ELAPSED::${TIME_ELAPSED}
- name: Generate html report
shell: bash
run: |
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
STAT=$(gopogh -in ./report/testout.json -out ./report/testout.html -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
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 ${GOPOGH_RESULT}
echo ""
echo $STAT | jq '.FailedTests' || true
- uses: actions/upload-artifact@v1
with:
name: podman_ubuntu_18_04
path: minikube_binaries/report
- name: The End Result
shell: bash
run: |
echo ${GOPOGH_RESULT}
echo "--------------------------------------------"
echo $STAT | jq '.FailedTests' || true
echo "--------------------------------------------"
numberOfFailures=$(echo $STAT | jq '.NumberOfFail')
if [ "$numberOfFailures" -gt 0 ];then echo "*** $numberOfFailures Failed ***";exit 2;fi
# After all 4 integration tests finished
# collect all the reports and upload
upload_all_reports:
if: always()
needs: [docker_ubuntu_16_04,docker_ubuntu_18_04,none_ubuntu16_04,none_ubuntu18_04,podman_ubuntu_18_04]
runs-on: ubuntu-18.04
steps: