Skip to content

chore: Enable GH actions workflows on 2.3.x branch #6

chore: Enable GH actions workflows on 2.3.x branch

chore: Enable GH actions workflows on 2.3.x branch #6

Workflow file for this run

# ---------------------------------------------------------------------------
# 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: E2E Tests
on:
pull_request:
branches:
- main
- release-2.3.x
push:
branches:
- main
- release-2.3.x
jobs:
test:
runs-on: ubuntu-latest
env:
YAKS_IMAGE_NAME: "docker.io/citrusframework/yaks"
YAKS_VERSION: "0.19.1"
YAKS_RUN_OPTIONS: "--timeout=15m"
KUBECTL_WAIT_TIMEOUT: "180s"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- 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@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Kind Cluster
uses: container-tools/kind-action@v2.0.4
with:
version: v0.22.0
node_image: kindest/node:v1.29.2@sha256:51a1434a5397193442f0be2a297b488b6c919ce8a3931be0ce822606ea5ca245
cpu: 3
- name: Info
run: |
kubectl version
kubectl cluster-info
kubectl describe nodes
- name: Camel K Tools
uses: container-tools/camel-k-action@v1.0.3
with:
version: v2.3.0
- name: Set JitPack dependency coordinates
env:
HEAD_REF: ${{ github.head_ref }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
run: |
echo "Set JitPack dependency coordinates to ${HEAD_REPO/\//.}:camel-kamelets-utils:${HEAD_REF//\//'~'}-SNAPSHOT"
export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
# Overwrite JitPack coordinates in the local Kamelets so the tests can use the utility classes in this branch or PR
find . -maxdepth 1 -name '*.kamelet.yaml' -exec sed -i "s/mvn:org.apache.camel.kamelets:camel-kamelets-utils:${PROJECT_VERSION}/github:${HEAD_REPO/\//.}:camel-kamelets-utils:${HEAD_REF//\//'~'}-SNAPSHOT/g" {} +
- name: Install Camel K
run: |
# Configure install options
export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY
export KAMEL_INSTALL_REGISTRY_INSECURE=true
kamel install --global --olm=false --operator-env-vars KAMEL_INSTALL_DEFAULT_KAMELETS=false -w
# Install the local kamelets
find . -maxdepth 1 -name '*.kamelet.yaml' -exec kubectl apply -f {} \;
- name: YAKS tools
uses: citrusframework/yaks-install-action@v1.0
with:
version: v${{ env.YAKS_VERSION }}
- name: Install YAKS
run: |
yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION
- name: YAKS Tests
run: |
yaks run test/extract-field $YAKS_RUN_OPTIONS
yaks run test/http-sink $YAKS_RUN_OPTIONS
yaks run test/insert-field $YAKS_RUN_OPTIONS
yaks run test/ftp/sink $YAKS_RUN_OPTIONS
yaks run test/ftp/source $YAKS_RUN_OPTIONS
yaks run test/kafka $YAKS_RUN_OPTIONS
yaks run test/postgresql $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