Skip to content

JKube E2E Tests (CRC-OKD) #30

JKube E2E Tests (CRC-OKD)

JKube E2E Tests (CRC-OKD) #30

#
# Copyright (c) 2019 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: JKube E2E Tests (CRC-OKD)
on:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 4 * * *' # Every day at 4am
concurrency:
group: single-instance-for-crc-okd-cluster
cancel-in-progress: true
env:
SHELL: /bin/bash
jobs:
build-jkube:
name: Build JKube
uses: ./.github/workflows/build-jkube.yml
with:
run-id: ${{ github.run_id }}
openshift-kubernetes-distribution:
name: CRC ${{ matrix.crc }} / OKD ${{ matrix.okd }} / ${{ matrix.suite }}
runs-on: ubuntu-latest
needs: build-jkube
strategy:
fail-fast: false
matrix:
# There is some problem with latest version of crc configured with okd preset. I
# wasn't able to run tests successfully on latest version of crc. See linked issue:
# https://github.com/crc-org/crc/issues/4382
# TODO: Update CRC version to latest when aforementioned issue gets resolved
okd: [ v4.14.0 ]
crc: [ 2.32.0 ]
suite: ['quarkus','springboot','webapp','other']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Java 11
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: '11'
distribution: 'temurin'
- name: Cache configuration
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
~/.m2/repository
./jkube
key: cache-it-${{ github.run_id }}
- name: Install required virtualization software
run: |
sudo apt-get update
sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system
# This package may not be present depending on Ubuntu version
sudo apt install virtiofsd || true
sudo usermod -a -G libvirt $USER
- name: Remove unwanted stuff to free up disk image
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
sudo docker image prune --all --force
sudo swapoff -a
sudo rm -f /mnt/swapfile
sudo adduser $USER libvirt
sudo adduser $USER kvm
sudo usermod -a -G libvirt $USER
- name: Download CRC
run: |
wget https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/${{ matrix.crc }}/crc-linux-amd64.tar.xz
tar -xJf crc-linux-amd64.tar.xz
sudo cp crc-linux-${{ matrix.crc }}-amd64/crc /usr/local/bin/crc
- name: Set the crc config
run: |
crc config set preset okd
crc config set network-mode user
- name: Setup the crc
run: |
sudo -su $USER crc setup
- name: Start the crc
run: sudo -su $USER crc start
- name: Install and Run Integration Tests
run: |
JKUBE_VERSION=$(./mvnw -q -f 'jkube/pom.xml' -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
&& ./mvnw -B -POpenShift,${{ matrix.suite }} verify -Djkube.version="$JKUBE_VERSION" -Djunit.jupiter.execution.parallel.config.fixed.parallelism=4