che-operator/.github/workflows/e2e.yaml

61 lines
2.2 KiB
YAML

#
# Copyright (c) 2012-2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
name: Minishift
on: pull_request
jobs:
minishift-e2e:
name: e2e tests
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Build operator image
run: |
export OPERATOR_IMAGE=quay.io/eclipse/che-operator:test
# coreutils provides a readlink that supports `-f`
brew install coreutils docker docker-machine
mkdir -p ~/.docker/machine/cache/
sudo curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso
docker-machine --github-api-token="${{ secrets.GITHUB_TOKEN }}" create --driver virtualbox default
eval "$(docker-machine env default)"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
docker build -t "${OPERATOR_IMAGE}" -f Dockerfile . && docker save "${OPERATOR_IMAGE}" > operator.tar
sed -i'.bak' -e "s|quay.io\/eclipse\/che-operator:nightly|$OPERATOR_IMAGE|" deploy/operator-local.yaml
docker-machine stop
- name: Install and start minishift OCP 3.11 cluster
run: |
brew cask install minishift
export MINISHIFT_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}
minishift start --memory=5500 --vm-driver=virtualbox
- name: Generate minishift certificates
run: /bin/bash .github/action_scripts/minishift_cert_gen.sh
- name: Update minishift deprecated certificates and run e2e
run: |
eval $(minishift oc-env)
eval $(minishift docker-env) && docker load -i operator.tar && rm operator.tar
# Run E2E tests
cat deploy/operator-local.yaml
oc apply -f deploy/crds/org_v1_che_crd.yaml
go mod tidy
go run e2e/*.go
oc get events -n che
- uses: actions/upload-artifact@v2
with:
name: minishift-e2e-artifacts
path: /tmp/artifacts-che