470 lines
18 KiB
YAML
470 lines
18 KiB
YAML
name: CI
|
|
on: [pull_request]
|
|
env:
|
|
GOPROXY: https://proxy.golang.org
|
|
jobs:
|
|
# Runs before all other jobs
|
|
# builds the minikube binaries
|
|
build_minikube:
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "Docker_Ubuntu_16_04"
|
|
GOPOGH_RESULT: ""
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Download Dependencies
|
|
run : go mod download
|
|
- name: Build Binaries
|
|
run : |
|
|
make minikube-linux-amd64
|
|
make e2e-linux-amd64
|
|
cp -r test/integration/testdata ./out
|
|
whoami
|
|
echo github ref $GITHUB_REF
|
|
echo workflow $GITHUB_WORKFLOW
|
|
echo home $HOME
|
|
echo event name $GITHUB_EVENT_NAME
|
|
echo workspace $GITHUB_WORKSPACE
|
|
echo "end of debug stuff"
|
|
echo $(which jq)
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: minikube_binaries
|
|
path: out
|
|
lint:
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "lint"
|
|
GOPOGH_RESULT: ""
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install libvirt
|
|
run : |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libvirt-dev
|
|
- name: Download Dependencies
|
|
run : go mod download
|
|
- name: Lint
|
|
env:
|
|
TESTSUITE: lintall
|
|
run : make test
|
|
continue-on-error: false
|
|
unit_test:
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "unit_test"
|
|
GOPOGH_RESULT: ""
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install libvirt
|
|
run : |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libvirt-dev
|
|
- name: Download Dependencies
|
|
run : go mod download
|
|
- name: Unit Test
|
|
env:
|
|
TESTSUITE: unittest
|
|
run :
|
|
make test
|
|
continue-on-error: false
|
|
# Run the following integration tests after the build_minikube
|
|
# They will run in parallel and use the binaries in previous step
|
|
docker_ubuntu_16_04:
|
|
needs: [build_minikube]
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "Docker_Ubuntu_16_04"
|
|
GOPOGH_RESULT: ""
|
|
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
|
|
runs-on: ubuntu-16.04
|
|
steps:
|
|
- name: Docker Info
|
|
shell: bash
|
|
run: |
|
|
docker info || true
|
|
docker version || true
|
|
docker ps || 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
|
|
- name: Download Binaries
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: minikube_binaries
|
|
- name: Run Integration Test
|
|
continue-on-error: true
|
|
# bash {0} to allow test to continue to next step. in case of
|
|
shell: bash {0}
|
|
run: |
|
|
cd minikube_binaries
|
|
mkdir -p report
|
|
mkdir -p testhome
|
|
chmod a+x e2e-*
|
|
chmod a+x minikube-*
|
|
START_TIME=$(date -u +%s)
|
|
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
|
END_TIME=$(date -u +%s)
|
|
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
|
min=$((${TIME_ELAPSED}/60))
|
|
sec=$((${TIME_ELAPSED}%60))
|
|
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 "${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}
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: docker_ubuntu_16_04
|
|
path: minikube_binaries/report
|
|
- name: The End Result Docker on ubuntu 16:04
|
|
shell: bash
|
|
run: |
|
|
echo ${GOPOGH_RESULT}
|
|
numFail=$(echo $STAT | jq '.NumberOfFail')
|
|
echo "----------------${numFail} Failures----------------------------"
|
|
echo $STAT | jq '.FailedTests' || true
|
|
echo "-------------------------------------------------------"
|
|
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
|
|
docker_ubuntu_18_04:
|
|
runs-on: ubuntu-18.04
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "Docker_Ubuntu_18_04"
|
|
GOPOGH_RESULT: ""
|
|
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
|
|
needs: [build_minikube]
|
|
steps:
|
|
- name: Docker Info
|
|
shell: bash
|
|
run: |
|
|
docker info || true
|
|
docker version || true
|
|
docker ps || 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
|
|
- name: Download Binaries
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: minikube_binaries
|
|
- name: Run Integration Test
|
|
continue-on-error: true
|
|
# bash {0} to allow test to continue to next step. in case of
|
|
shell: bash {0}
|
|
run: |
|
|
cd minikube_binaries
|
|
mkdir -p report
|
|
mkdir -p testhome
|
|
chmod a+x e2e-*
|
|
chmod a+x minikube-*
|
|
START_TIME=$(date -u +%s)
|
|
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--driver=docker -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
|
END_TIME=$(date -u +%s)
|
|
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
|
min=$((${TIME_ELAPSED}/60))
|
|
sec=$((${TIME_ELAPSED}%60))
|
|
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 "${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}
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: docker_ubuntu_18_04
|
|
path: minikube_binaries/report
|
|
- name: The End Result - Docker On Ubuntu 18:04
|
|
shell: bash
|
|
run: |
|
|
echo ${GOPOGH_RESULT}
|
|
numFail=$(echo $STAT | jq '.NumberOfFail')
|
|
echo "----------------${numFail} Failures----------------------------"
|
|
echo $STAT | jq '.FailedTests' || true
|
|
echo "-------------------------------------------------------"
|
|
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
|
|
none_ubuntu16_04:
|
|
needs: [build_minikube]
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "None_Ubuntu_16_04"
|
|
GOPOGH_RESULT: ""
|
|
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
|
|
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
|
|
- name: Download Binaries
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: minikube_binaries
|
|
- name: Run Integration Test
|
|
continue-on-error: true
|
|
# bash {0} to allow test to continue to next step. in case of
|
|
shell: bash {0}
|
|
run: |
|
|
cd minikube_binaries
|
|
mkdir -p report
|
|
mkdir -p testhome
|
|
chmod a+x e2e-*
|
|
chmod a+x minikube-*
|
|
START_TIME=$(date -u +%s)
|
|
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--driver=none -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
|
END_TIME=$(date -u +%s)
|
|
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
|
min=$((${TIME_ELAPSED}/60))
|
|
sec=$((${TIME_ELAPSED}%60))
|
|
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 "${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}
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: none_ubuntu16_04
|
|
path: minikube_binaries/report
|
|
- name: The End Result - None On Ubuntu 16:04
|
|
shell: bash
|
|
run: |
|
|
echo ${GOPOGH_RESULT}
|
|
numFail=$(echo $STAT | jq '.NumberOfFail')
|
|
echo "----------------${numFail} Failures----------------------------"
|
|
echo $STAT | jq '.FailedTests' || true
|
|
echo "-------------------------------------------------------"
|
|
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
|
|
none_ubuntu18_04:
|
|
needs: [build_minikube]
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "None_Ubuntu_18_04"
|
|
GOPOGH_RESULT: ""
|
|
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
|
|
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
|
|
- name: Download Binaries
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: minikube_binaries
|
|
- name: Run Integration Test
|
|
continue-on-error: true
|
|
# bash {0} to allow test to continue to next step. in case of
|
|
shell: bash {0}
|
|
run: |
|
|
cd minikube_binaries
|
|
mkdir -p report
|
|
mkdir -p testhome
|
|
chmod a+x e2e-*
|
|
chmod a+x minikube-*
|
|
START_TIME=$(date -u +%s)
|
|
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--driver=none -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
|
END_TIME=$(date -u +%s)
|
|
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
|
min=$((${TIME_ELAPSED}/60))
|
|
sec=$((${TIME_ELAPSED}%60))
|
|
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 "${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}
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: none_ubuntu18_04
|
|
path: minikube_binaries/report
|
|
- name: The End Result - None on Ubuntu 18:04
|
|
shell: bash
|
|
run: |
|
|
echo ${GOPOGH_RESULT}
|
|
numFail=$(echo $STAT | jq '.NumberOfFail')
|
|
echo "----------------${numFail} Failures----------------------------"
|
|
echo $STAT | jq '.FailedTests' || true
|
|
echo "-------------------------------------------------------"
|
|
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
|
|
podman_ubuntu_18_04:
|
|
needs: [build_minikube]
|
|
env:
|
|
TIME_ELAPSED: time
|
|
JOB_NAME: "Podman_Ubuntu_18_04"
|
|
GOPOGH_RESULT: ""
|
|
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
|
|
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"
|
|
wget -q https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add -
|
|
sudo apt-key add - < Release.key || true
|
|
sudo apt-get update -qq
|
|
sudo apt-get -qq -y install podman
|
|
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
|
|
- name: Download binaries
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: minikube_binaries
|
|
- name: Run Integration Test
|
|
continue-on-error: true
|
|
# bash {0} to allow test to continue to next step. in case of
|
|
shell: bash {0}
|
|
run: |
|
|
cd minikube_binaries
|
|
mkdir -p report
|
|
mkdir -p testhome
|
|
chmod a+x e2e-*
|
|
chmod a+x minikube-*
|
|
START_TIME=$(date -u +%s)
|
|
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--driver=podman -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
|
END_TIME=$(date -u +%s)
|
|
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
|
min=$((${TIME_ELAPSED}/60))
|
|
sec=$((${TIME_ELAPSED}%60))
|
|
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 "${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}
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: podman_ubuntu_18_04
|
|
path: minikube_binaries/report
|
|
- name: The End Result - Podman On Ubuntu 18:04
|
|
shell: bash
|
|
run: |
|
|
echo ${GOPOGH_RESULT}
|
|
numFail=$(echo $STAT | jq '.NumberOfFail')
|
|
echo "----------------${numFail} Failures----------------------------"
|
|
echo $STAT | jq '.FailedTests' || true
|
|
echo "-------------------------------------------------------"
|
|
if [ "$numFail" -gt 0 ];then echo "*** $numFail 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:
|
|
- name: Download Results docker_ubuntu_16_04
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: docker_ubuntu_16_04
|
|
- name: cp docker_ubuntu_16_04 to all_report
|
|
continue-on-error: true
|
|
shell: bash {0}
|
|
run: |
|
|
mkdir -p all_reports
|
|
cp -r docker_ubuntu_16_04 ./all_reports/
|
|
- name: Download Results docker_ubuntu_18_04
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: docker_ubuntu_18_04
|
|
- name: cp docker_ubuntu_18_04 to all_report
|
|
continue-on-error: true
|
|
shell: bash {0}
|
|
run: |
|
|
mkdir -p all_reports
|
|
cp -r docker_ubuntu_18_04 ./all_reports/
|
|
- name: Download Results none_ubuntu16_04
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: none_ubuntu16_04
|
|
- name: cp none_ubuntu16_04 to all_report
|
|
continue-on-error: true
|
|
shell: bash {0}
|
|
run: |
|
|
mkdir -p all_reports
|
|
cp -r none_ubuntu16_04 ./all_reports/
|
|
- name: Download Results none_ubuntu18_04
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: none_ubuntu18_04
|
|
- name: Copy none_ubuntu18_04 to all_report
|
|
continue-on-error: true
|
|
shell: bash {0}
|
|
run: |
|
|
mkdir -p all_reports
|
|
cp -r none_ubuntu18_04 ./all_reports/
|
|
- name: Download Results podman_ubuntu_18_04
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: podman_ubuntu_18_04
|
|
- name: Copy podman_ubuntu_18_04 to all_report
|
|
continue-on-error: true
|
|
shell: bash {0}
|
|
run: |
|
|
mkdir -p all_reports
|
|
cp -r podman_ubuntu_18_04 ./all_reports/
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: all_reports
|
|
path: all_reports
|