Skip to content

Commit

Permalink
ci : Add github action workflow for okd 4.14.0 cluster with crc
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Oct 9, 2024
1 parent 0589ad7 commit d042a7c
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/e2e-crc-okd-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#
# 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: E2E CRC OKD Jkube Integration Tests

on:
workflow_dispatch:
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
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 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: Login into OpenShift Cluster
run: |
sudo -su $USER eval $(crc oc-env)
sudo -su $USER oc version
LOGIN_COMMAND=`sudo -su $USER crc console --credentials | grep admin | awk -F"'" '$0=$2'`
eval $LOGIN_COMMAND
- 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

0 comments on commit d042a7c

Please sign in to comment.