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

60 lines
2.1 KiB
YAML

#
# Copyright (c) 2019-2021 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: Testing latest changes
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
# All docker operations should be done in this step
- name: Build Che operator image
run: |
export OPERATOR_IMAGE=test/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}" > /tmp/operator.tar
docker-machine stop
- name: Provision Minishift cluster
run: |
brew install minishift
export MINISHIFT_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}
minishift start --memory=5500 --vm-driver=virtualbox --registry-mirror=https://quay.io
- name: Install chectl
run: bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next
- name: Replace Minishift default certificates
run: /bin/bash .github/bin/minishift/certs.sh
- name: Install jq
run: sudo pip install yq
- name: Run tests
run: |
eval $(minishift oc-env)
/bin/bash .github/bin/minishift/test-operator.sh
# Run this step even the previous step fail
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: minishift-latests-artifacts
path: /tmp/artifacts-che