From a3c8e636a2c2a495b36f43630692b0c541d3f6ad Mon Sep 17 00:00:00 2001 From: ChengXiangdong Date: Mon, 7 Nov 2022 18:34:48 +0800 Subject: [PATCH] add E2E test workflow --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ hack/pre-run-e2e.sh | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4325d8119..1386b87ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,3 +51,28 @@ jobs: go-version: 1.15.x - name: make test run: make test + e2e: + name: e2e test + needs: build + runs-on: self-hosted + strategy: + max-parallel: 1 + steps: + - name: checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: install Go + uses: actions/setup-go@v3 + with: + go-version: 1.15.x + - name: run e2e + run: | + export ARTIFACTS_PATH=${{ github.workspace }}/e2e-logs + sh hack/run-e2e.sh + - name: upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: e2e_log + path: ${{ github.workspace }}/e2e-logs/ diff --git a/hack/pre-run-e2e.sh b/hack/pre-run-e2e.sh index 987db1a7a..b266c365f 100755 --- a/hack/pre-run-e2e.sh +++ b/hack/pre-run-e2e.sh @@ -15,16 +15,16 @@ # limitations under the License. set -o errexit -set -o nounset set -o pipefail if [[ "${HC_ACCESS_KEY}" = "" ]] || [[ "${HC_SECRET_KEY}" = "" ]]; then echo "HC_ACCESS_KEY and HC_SECRET_KEY can not be empty, please set it" exit 1 fi +set -o nounset export REGISTRY_SERVER_ADDRESS=swr.ap-southeast-1.myhuaweicloud.com -export VERSION=`git rev-parse --short HEAD` +export VERSION=`echo $RANDOM` echo -e "\nBuild images" # todo: Maybe we need load the image to target cluster node.