-
Notifications
You must be signed in to change notification settings - Fork 8
118 lines (110 loc) · 3.98 KB
/
e2e-crc-okd-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# 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