From cc99478f71a50efd94c7c2cee8cd19aa83b327c0 Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Thu, 24 Aug 2023 15:55:08 +0200 Subject: [PATCH] chore(ci): Add nightly GitHub actions workflow Runs tests with the latest Camel K versions on a nightly basis --- .github/workflows/nightly.yml | 204 ++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..ddbfdeb --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,204 @@ +# --------------------------------------------------------------------------- +# 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: Nightly + +on: + workflow_dispatch: + schedule: + - cron: "15 0 * * 1-5" + +jobs: + preview: + strategy: + matrix: + version: + - 1.10.5-nightly + runs-on: ubuntu-latest + env: + YAKS_VERSION: 0.15.1 + YAKS_IMAGE_NAME: "docker.io/citrusframework/yaks" + YAKS_RUN_OPTIONS: "--timeout=15m" + KNATIVE_SERVING_VERSION: v1.9.4 + KNATIVE_EVENTING_VERSION: v1.9.7 + KNATIVE_KOURIER_VERSION: v1.9.2 + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Cleanup + run: | + ls -lart + echo "Initial status:" + df -h + + echo "Cleaning up resources:" + sudo swapoff -a + sudo rm -f /swapfile + sudo apt clean + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + docker rmi $(docker image ls -aq) + + echo "Final status:" + df -h + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Kind Cluster + uses: container-tools/kind-action@v2.0.1 + with: + version: v0.17.0 + node_image: kindest/node:v1.28.0@sha256:9f3ff58f19dcf1a0611d11e8ac989fdb30a28f40f236f59f0bea31fb956ccf5c + knative_serving: ${{ env.KNATIVE_SERVING_VERSION }} + knative_eventing: ${{ env.KNATIVE_EVENTING_VERSION }} + knative_kourier: ${{ env.KNATIVE_KOURIER_VERSION }} + - name: Info + run: | + kubectl version + kubectl cluster-info + kubectl describe nodes + - name: Install Knative + run: | + kubectl apply -f https://github.com/knative/serving/releases/download/knative-${{ env.KNATIVE_SERVING_VERSION }}/serving-default-domain.yaml + - name: Camel K Tools + uses: container-tools/camel-k-action@v1.0.3 + with: + version: ${{ matrix.version }} + - name: Install Camel K + run: | + # Configure install options + export KAMEL_INSTALL_BUILD_PUBLISH_STRATEGY=Spectrum + export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY + export KAMEL_INSTALL_REGISTRY_INSECURE=true + + kamel install --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots + - name: YAKS tools + uses: citrusframework/yaks-install-action@v1.1 + with: + version: v${{ env.YAKS_VERSION }} + - name: Install YAKS + run: | + yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION + - name: YAKS Tests + run: | + # Then run integration tests + yaks run test/consumers $YAKS_RUN_OPTIONS + yaks run test/user-report $YAKS_RUN_OPTIONS + yaks run test/bridges $YAKS_RUN_OPTIONS + - name: YAKS Report + if: failure() + run: | + yaks report + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: dumps + path: _output/*-dump.log + test: + strategy: + matrix: + version: + - 1.10.4 + - 1.10.2 + runs-on: ubuntu-latest + env: + YAKS_VERSION: 0.15.1 + YAKS_IMAGE_NAME: "docker.io/citrusframework/yaks" + YAKS_RUN_OPTIONS: "--timeout=15m" + KNATIVE_SERVING_VERSION: v1.9.4 + KNATIVE_EVENTING_VERSION: v1.9.7 + KNATIVE_KOURIER_VERSION: v1.9.2 + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Cleanup + run: | + ls -lart + echo "Initial status:" + df -h + + echo "Cleaning up resources:" + sudo swapoff -a + sudo rm -f /swapfile + sudo apt clean + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + docker rmi $(docker image ls -aq) + + echo "Final status:" + df -h + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Kind Cluster + uses: container-tools/kind-action@v2.0.1 + with: + version: v0.17.0 + node_image: kindest/node:v1.28.0@sha256:9f3ff58f19dcf1a0611d11e8ac989fdb30a28f40f236f59f0bea31fb956ccf5c + knative_serving: ${{ env.KNATIVE_SERVING_VERSION }} + knative_eventing: ${{ env.KNATIVE_EVENTING_VERSION }} + knative_kourier: ${{ env.KNATIVE_KOURIER_VERSION }} + - name: Info + run: | + kubectl version + kubectl cluster-info + kubectl describe nodes + - name: Install Knative + run: | + kubectl apply -f https://github.com/knative/serving/releases/download/knative-${{ env.KNATIVE_SERVING_VERSION }}/serving-default-domain.yaml + - name: Camel K Tools + uses: container-tools/camel-k-action@v1.0.3 + with: + version: v${{ matrix.version }} + - name: Install Camel K + run: | + # Configure install options + export KAMEL_INSTALL_BUILD_PUBLISH_STRATEGY=Spectrum + export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY + export KAMEL_INSTALL_REGISTRY_INSECURE=true + + kamel install + - name: YAKS tools + uses: citrusframework/yaks-install-action@v1.1 + with: + version: v${{ env.YAKS_VERSION }} + - name: Install YAKS + run: | + yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION + - name: YAKS Tests + run: | + # Then run integration tests + yaks run test/consumers $YAKS_RUN_OPTIONS + yaks run test/user-report $YAKS_RUN_OPTIONS + yaks run test/bridges $YAKS_RUN_OPTIONS + - name: YAKS Report + if: failure() + run: | + yaks report + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: dumps + path: _output/*-dump.log