pull_request #5223
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
name: JKube E2E Tests | |
on: | |
repository_dispatch: | |
types: [pull_request] | |
env: | |
ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
permissions: | |
contents: read | |
jobs: | |
bootstrap-CI-test-run: | |
name: Bootstrap CI test run (#${{ github.event.client_payload.pr }}) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Cache .m2 and JKube | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 | |
with: | |
path: | | |
${{ github.workspace }}/jkube | |
${{ github.workspace }}/jkube-it | |
~/.m2/repository | |
key: cache-e2e-bootstrap-${{ github.run_id }} | |
- name: Bootstrap | |
run: | | |
node src/index.js init \ | |
--pr=${{ github.event.client_payload.pr }} \ | |
--runId=${{ github.run_id }} | |
- name: Checkout repositories and Install JKube | |
run: | | |
node src/index.js checkout \ | |
--pr=${{ github.event.client_payload.pr }} \ | |
--runId=${{ github.run_id }} | |
minikube: | |
name: K8S ${{ matrix.kubernetes }} ${{ matrix.suite }} (#${{ github.event.client_payload.pr }}) | |
needs: bootstrap-CI-test-run | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
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@v4 | |
- name: Restore cache .m2 and JKube | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 | |
with: | |
path: | | |
${{ github.workspace }}/jkube | |
${{ github.workspace }}/jkube-it | |
~/.m2/repository | |
key: cache-e2e-bootstrap-${{ github.run_id }} | |
- name: Update PR report status | |
run: | | |
node src/index.js update-status \ | |
--pr=${{ github.event.client_payload.pr }} \ | |
--runId=${{ github.run_id }} | |
- name: Setup Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Setup Minikube-Kubernetes | |
uses: manusa/actions-setup-minikube@v2.11.0 | |
with: | |
minikube version: v1.31.2 | |
kubernetes version: ${{ matrix.kubernetes }} | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
start args: --force | |
- name: Install and Run Integration Tests | |
run: | | |
JKUBE_VERSION=$(mvn -f jkube/pom.xml -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \ | |
&& cd jkube-it \ | |
&& ./mvnw -B -PKubernetes,${{ matrix.suite }} verify -Djkube.version="$JKUBE_VERSION" | |
- name: Consolidate reports | |
if: always() | |
run: | | |
mkdir -p ./reports \ | |
&& cp ./jkube-it/it/target/jkube-test-report.txt ./reports | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@master | |
with: | |
name: Test reports (Minikube ${{ matrix.kubernetes }}-${{ matrix.suite }}) | |
path: ./reports | |
- name: Update PR report status | |
if: always() | |
run: | | |
node src/index.js update-status \ | |
--pr=${{ github.event.client_payload.pr }} \ | |
--runId=${{ github.run_id }} | |
openshift: | |
name: OpenShift ${{ matrix.openshift }} ${{ matrix.suite }} (#${{ github.event.client_payload.pr }}) | |
needs: bootstrap-CI-test-run | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
openshift: [v3.10.0] | |
suite: ['quarkus','springboot','webapp','other'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Restore cache .m2 and JKube | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 | |
with: | |
path: | | |
${{ github.workspace }}/jkube | |
${{ github.workspace }}/jkube-it | |
~/.m2/repository | |
key: cache-e2e-bootstrap-${{ github.run_id }} | |
- name: Update PR report status | |
run: | | |
node src/index.js update-status \ | |
--pr=${{ github.event.client_payload.pr }} \ | |
--runId=${{ github.run_id }} | |
- name: Free up Space | |
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: Setup Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Setup OpenShift | |
uses: manusa/actions-setup-openshift@v1.1.5 | |
with: | |
oc version: ${{ matrix.openshift }} | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install and Run Integration Tests | |
run: | | |
JKUBE_VERSION=$(mvn -f jkube/pom.xml -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \ | |
&& cd jkube-it \ | |
&& ./mvnw -B -POpenShift,${{ matrix.suite }} verify -Djkube.version="$JKUBE_VERSION" -Djunit.jupiter.execution.parallel.config.fixed.parallelism=4 | |
- name: Consolidate reports | |
if: always() | |
run: | | |
mkdir -p ./reports \ | |
&& cp ./jkube-it/it/target/jkube-test-report.txt ./reports | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test reports (OpenShift ${{ matrix.openshift }}-${{ matrix.suite }}) | |
path: ./reports | |
- name: Update PR report status | |
if: always() | |
run: | | |
node src/index.js update-status \ | |
--pr=${{ github.event.client_payload.pr }} \ | |
--runId=${{ github.run_id }} | |
windows: | |
name: Windows (#${{ github.event.client_payload.pr }}) | |
needs: bootstrap-CI-test-run | |
runs-on: windows-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Allow long Git filenames in Windows | |
run: git config --system core.longpaths true | |
- name: Update PR report status | |
run: | | |
node src/index.js update-status --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }} | |
- name: Checkout repositories and Install JKube | |
run: | | |
node src/index.js checkout --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }} | |
- name: Install and Run Integration Tests | |
run: | | |
$env:JKUBE_VERSION = (mvn -f jkube\pom.xml org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression='project.version' -q -DforceStdout) | Out-String | |
echo $env:JKUBE_VERSION | |
cd jkube-it | |
mvn -B -PWindows clean verify -D'jkube.version'=$env:JKUBE_VERSION | |
- name: Consolidate reports | |
if: always() | |
run: | | |
mkdir reports | |
cp jkube-it\it\target\jkube-test-report.txt reports | |
- name: Save reports as artifact | |
if: always() | |
uses: actions/upload-artifact@master | |
with: | |
name: Test reports (Windows) | |
path: ./reports | |
- name: Update PR report status | |
if: always() | |
run: | | |
node src/index.js update-status --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }} | |
# Trigger the e2e-report workflow so that the complete report gets published | |
teardown: | |
name: Finish CI test run | |
runs-on: ubuntu-latest | |
needs: [minikube, openshift, windows] | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update PR report status | |
run: | | |
node src/index.js update-status --pr=${{ github.event.client_payload.pr }} --runId=${{ github.run_id }} | |
- name: Trigger report workflow | |
run: | | |
curl -X POST \ | |
https://api.github.com/repos/${{ github.repository }}/dispatches \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-u "${{ secrets.GH_ACCESS_TOKEN_USER }}:${{ secrets.GH_ACCESS_TOKEN }}" \ | |
-d '{"event_type":"generate_report","client_payload":{"pr":"${{ github.event.client_payload.pr }}","e2e_run_id":"${{ github.run_id }}"}}' |