ci : Add github action workflow for okd 4.14.0 cluster with crc #2452
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: '0 1 * * *' # Every day at 1 | |
permissions: | |
contents: read | |
jobs: | |
build-jkube: | |
name: Build JKube | |
uses: ./.github/workflows/build-jkube.yml | |
with: | |
run-id: ${{ github.run_id }} | |
minikube: | |
name: K8S | |
needs: build-jkube | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
kubernetes: [v1.25.13,v1.28.1] | |
suite: ['quarkus','quarkus-native','springboot','webapp','other','dockerfile'] | |
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: Setup Minikube-Kubernetes | |
uses: manusa/actions-setup-minikube@3856c6fa039819f1c8e7e248b1fc5a8564e354c9 | |
with: | |
minikube version: v1.31.2 | |
kubernetes version: ${{ matrix.kubernetes }} | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
start args: --force | |
- name: Harden Runner | |
uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85 | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
auth.docker.io:443 | |
azure.archive.ubuntu.com:80 | |
cdn03.quay.io:443 | |
downloads.gradle.org:443 | |
gcr.io:443 | |
github.com:443 | |
jcenter.bintray.com:443 | |
k8s.gcr.io:443 | |
maven.repository.redhat.com:443 | |
md-hdd-51w5snc21ccf.z49.blob.storage.azure.net:443 | |
md-hdd-bfh3mwcdlxsh.z21.blob.storage.azure.net:443 | |
md-hdd-dxgvrxd2cnjf.z22.blob.storage.azure.net:443 | |
objects.githubusercontent.com:443 | |
packages.microsoft.com:443 | |
plugins-artifacts.gradle.org:443 | |
plugins.gradle.org:443 | |
ppa.launchpadcontent.net:443 | |
ppa.launchpad.net:80 | |
production.cloudflare.docker.com:443 | |
quay.io:443 | |
services.gradle.org:443 | |
registry-1.docker.io:443 | |
registry.access.redhat.com:443 | |
registry.k8s.io:443 | |
repo1.maven.org:443 | |
repo.maven.apache.org:443 | |
repository.jboss.org:443 | |
storage.googleapis.com:443 | |
us-south1-docker.pkg.dev:443 | |
us-west2-docker.pkg.dev:443 | |
us-east4-docker.pkg.dev:443 | |
- 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 -PKubernetes,${{ matrix.suite }} clean verify -Djkube.version="$JKUBE_VERSION" | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: Test reports (Minikube ${{ matrix.kubernetes }}-${{ matrix.suite }}) | |
path: ./it/target/jkube-test-report.txt | |
minikube-legacy: | |
name: K8S | |
needs: build-jkube | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
suite: ['quarkus','quarkus-native','springboot','webapp','other','dockerfile'] | |
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: Setup Minikube-Kubernetes | |
uses: manusa/actions-setup-minikube@3856c6fa039819f1c8e7e248b1fc5a8564e354c9 | |
with: | |
minikube version: v1.31.2 | |
kubernetes version: v1.12.10 | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
start args: --force | |
- name: Harden Runner | |
uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85 | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
auth.docker.io:443 | |
azure.archive.ubuntu.com:80 | |
cdn03.quay.io:443 | |
downloads.gradle.org:443 | |
gcr.io:443 | |
github.com:443 | |
jcenter.bintray.com:443 | |
k8s.gcr.io:443 | |
maven.repository.redhat.com:443 | |
md-hdd-51w5snc21ccf.z49.blob.storage.azure.net:443 | |
md-hdd-bfh3mwcdlxsh.z21.blob.storage.azure.net:443 | |
md-hdd-dxgvrxd2cnjf.z22.blob.storage.azure.net:443 | |
objects.githubusercontent.com:443 | |
packages.microsoft.com:443 | |
plugins-artifacts.gradle.org:443 | |
plugins.gradle.org:443 | |
ppa.launchpadcontent.net:443 | |
ppa.launchpad.net:80 | |
production.cloudflare.docker.com:443 | |
quay.io:443 | |
services.gradle.org:443 | |
registry-1.docker.io:443 | |
registry.access.redhat.com:443 | |
registry.k8s.io:443 | |
repo1.maven.org:443 | |
repo.maven.apache.org:443 | |
repository.jboss.org:443 | |
storage.googleapis.com:443 | |
us-south1-docker.pkg.dev:443 | |
us-west2-docker.pkg.dev:443 | |
us-east4-docker.pkg.dev:443 | |
- 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 -PKubernetes,${{ matrix.suite }} clean verify -Djkube.version="$JKUBE_VERSION" | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: Test reports (Minikube ${{ matrix.kubernetes }}-${{ matrix.suite }}) | |
path: ./it/target/jkube-test-report.txt | |
openshift: | |
name: OpenShift | |
needs: build-jkube | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
openshift: [v3.10.0] | |
suite: ['quarkus','springboot','webapp','other'] | |
steps: | |
# This seems to cause problems with OpenShift Setup Action | |
# - name: Harden Runner | |
# uses: step-security/harden-runner@398bb08048482c421b1da00a58a1b472a306eb85 | |
# with: | |
# egress-policy: audit | |
- name: Free up Space | |
# 'linux-headers.*' \ # Takes > 2 minutes | |
# 'google-cloud.*' \ | |
run: | | |
sudo apt list --installed | |
sudo apt-get purge -y \ | |
'aspnetcore.*' \ | |
'cabal-install.*' \ | |
'clang.*' \ | |
'dotnet.*' \ | |
'firefox.*' \ | |
'ghc.*' \ | |
'google-chrome.*' \ | |
'libmagic.*' \ | |
'libmono.*' \ | |
'mono-.*' \ | |
'mysql.*' \ | |
'php.*' \ | |
'ruby.*' | |
sudo apt-get autoremove | |
df -h | |
- 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: Check Docker Status | |
run: systemctl status docker.service | |
- name: Setup OpenShift | |
uses: manusa/actions-setup-openshift@e59fe3caa18d7cde81e2ce4797e6549a13f7648c | |
with: | |
oc version: ${{ matrix.openshift }} | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
- 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 | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: Test reports (OpenShift ${{ matrix.openshift }}-${{ matrix.suite }}) | |
path: ./it/target/jkube-test-report.txt | |
- name: Cluster Information | |
if: always() | |
run: | | |
oc login -u system:admin | |
oc describe node localhost | |
oc login -u developer | |
openshift-kubernetes-distribution: | |
name: OKD | |
needs: build-jkube | |
runs-on: ubuntu-latest | |
env: | |
SHELL: /bin/bash | |
strategy: | |
fail-fast: false | |
matrix: | |
# OKD version is bound to crc version | |
okd: [v4.14.0] | |
crc: [2.32.0] | |
suite: [ 'quarkus','springboot','webapp','other' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Cache configuration | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 | |
with: | |
path: | | |
~/.m2/repository | |
./jkube | |
key: cache-it-${{ github.run_id }} | |
- name: Setup Java 11 | |
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- 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 | |
sudo -su $USER oc api-resources | |
- 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 | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: Test reports (OKD ${{ matrix.okd }}-${{ matrix.suite }}) | |
path: ./it/target/jkube-test-report.txt |