Skip to content

Feat/omb container image (#3273) #120

Feat/omb container image (#3273)

Feat/omb container image (#3273) #120

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Documentation Tests
on:
push:
branches: [ main, 'release/**' ]
pull_request:
types: [ opened, synchronize, reopened ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_operator:
runs-on: ubuntu-latest
steps:
- name: 'Test for Slack secret'
env:
KROXYLICIOUS_SLACK_WEBHOOK: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
run: |
echo "SLACK_WEBHOOK_SET=$(test ${KROXYLICIOUS_SLACK_WEBHOOK} && echo true)" >> $GITHUB_ENV
- name: 'Check out repository'
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
- name: 'Set up Java'
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'temurin'
- name: Setup Minikube
uses: manusa/actions-setup-minikube@b589f2d61bf96695c546929c72b38563e856059d
with:
"minikube version": 'v1.35.0'
"kubernetes version": 'v1.32.0'
"github token": ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
- name: 'Cache Maven packages'
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: 'Build Kroxylicious Operator/Operand Container Images & Operator Zip'
run: |
mvn --batch-mode --activate-profiles dist --also-make --projects :kroxylicious-app,:kroxylicious-operator,:kroxylicious-operator-dist -Dquick package
- name: 'Load Kroxylicious Operand Docker Image in Minikube'
run: |
minikube image load kroxylicious-app/target/kroxylicious-proxy.img.tar.gz
minikube image load kroxylicious-operator/target/kroxylicious-operator.img.tar.gz
# https://github.com/kubernetes/minikube/issues/21393 - minikube image load doesn't fail if the load fails.
KROXYLICIOUS_PROXY_IMAGE="$(mvn --quiet --projects kroxylicious-app --activate-profiles dist org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=io.kroxylicious.proxy.image.name -DforceStdout)"
KROXYLICIOUS_OPERATOR_IMAGE="$(mvn --quiet --projects kroxylicious-operator --activate-profiles dist org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=io.kroxylicious.operator.image.name -DforceStdout)"
minikube image ls | grep --fixed-strings ${KROXYLICIOUS_PROXY_IMAGE}
minikube image ls | grep --fixed-strings ${KROXYLICIOUS_OPERATOR_IMAGE}
- name: 'Run documentation tests'
run: |
mvn -Djapicmp.skip=true -DskipUTs=true -DskipITs=true -DskipKTs=true -DskipDTs=false --batch-mode verify --activate-profiles dist --projects ':kroxylicious-docs-tests' --also-make
- name: Slack Notification on Failure
if: failure() && env.SLACK_WEBHOOK_SET == 'true'
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
env:
SLACK_WEBHOOK: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
SLACK_COLOR: 'danger'
SLACK_TITLE: 'Failure Alert: ${{ github.repository }}'
SLACK_MESSAGE: 'The documentation tests workflow failed on branch ${{ github.ref_name }}.'