Skip to content

fix: microshift workflow should run on pushes to main too. (#3578) #408

fix: microshift workflow should run on pushes to main too. (#3578)

fix: microshift workflow should run on pushes to main too. (#3578) #408

#
# 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- name: Setup Java
uses: ./.github/actions/common/setup-java
- name: Setup Minikube
uses: ./.github/actions/common/setup-minikube
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: 'Cache Maven packages'
uses: ./.github/actions/common/cache-maven-packages
- 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)"
KROXYLICIOUS_VERSION="$(mvn --quiet org.apache.maven.plugins:maven-help-plugin:3.5.1:evaluate -Dexpression=project.version -DforceStdout)"
minikube image tag ${KROXYLICIOUS_PROXY_IMAGE} quay.io/kroxylicious/kroxylicious:${KROXYLICIOUS_VERSION}
minikube image ls | grep --fixed-strings quay.io/kroxylicious/kroxylicious:${KROXYLICIOUS_VERSION}
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: ./.github/actions/common/slack-notification
with:
slackWebhook: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }}
slackTitle: 'Failure Alert: ${{ github.repository }}'
slackMessage: 'The documentation tests workflow failed on branch ${{ github.ref_name }}.'