Skip to content

Commit

Permalink
chore: Enable GH actions workflows on 2.3.x branch
Browse files Browse the repository at this point in the history
- Update YAKS 0.19.1
- Use Pipe custom resource
- Use JitPack dependencies in Kamelets pointing to current branch SNAPSHOT
  • Loading branch information
christophd committed May 2, 2024
1 parent 0524fdf commit 3ea30ae
Show file tree
Hide file tree
Showing 68 changed files with 449 additions and 283 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,31 @@
# limitations under the License.
# ---------------------------------------------------------------------------

name: Kubernetes
name: E2E Tests

on:
pull_request:
branches:
- main
- kamelet-catalog-1.6
- release-2.3.x
push:
branches:
- main
- kamelet-catalog-1.6
- release-2.3.x

jobs:
test:
runs-on: ubuntu-latest
env:
YAKS_IMAGE_NAME: "docker.io/yaks/yaks"
YAKS_VERSION: "0.9.0-202202081449"
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@v2
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cleanup
run: |
ls -lart
Expand All @@ -56,41 +58,51 @@ jobs:
echo "Final status:"
df -h
- name: Set up JDK 11
uses: AdoptOpenJDK/install-jdk@v1
- name: Set up JDK
uses: actions/setup-java@v4
with:
version: "11"
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Kind Cluster
uses: container-tools/kind-action@v1
uses: container-tools/kind-action@v2.0.4
with:
version: v0.11.0
node_image: kindest/node:v1.21.1@sha256:fae9a58f17f18f06aeac9772ca8b5ac680ebbed985e266f711d936e91d113bad
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
uses: container-tools/camel-k-action@v1.0.3
with:
version: v1.6.0
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_BUILD_PUBLISH_STRATEGY=Spectrum
export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY
export KAMEL_INSTALL_REGISTRY_INSECURE=true
kamel install -w
# TODO replaces the below statement with --operator-env-vars KAMEL_INSTALL_DEFAULT_KAMELETS=false
# when we use camel k 1.8.0
kubectl delete kamelets --all
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: ${{ env.YAKS_VERSION }}
version: v${{ env.YAKS_VERSION }}
- name: Install YAKS
run: |
yaks install --operator-image $YAKS_IMAGE_NAME:$YAKS_VERSION
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: Publish Website
on:
push:
branches:
- kamelet-catalog-1.4
- main
- main
- release-2.3.x
jobs:
publish-pages:
runs-on: ubuntu-latest
if: github.repository == 'openshift-integration/kamelet-catalog'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: kamelet-catalog-1.4
ref: release-2.3.x
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: main
- name: Build
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ on:
pull_request:
branches:
- main
- kamelet-catalog-1.3
- kamelet-catalog-1.4
- kamelet-catalog-1.6
- release-2.3.x
paths-ignore:
- '**.adoc'
- 'KEYS'
Expand All @@ -32,9 +30,7 @@ on:
push:
branches:
- main
- kamelet-catalog-1.3
- kamelet-catalog-1.4
- kamelet-catalog-1.6
- release-2.3.x
paths-ignore:
- '**.adoc'
- 'KEYS'
Expand All @@ -46,11 +42,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: 1.15.x
go-version: 1.20.x
- name: Run Validator
run: |
echo "Running Kamelet validator..."
Expand Down
12 changes: 6 additions & 6 deletions test/aws-kinesis/aws-kinesis-inmem-binding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Feature: AWS-Kinesis Kamelet
| aws.kinesis.command | "create-stream", "--stream-name", "${camel.kamelet.aws-kinesis-source.aws-kinesis-credentials.stream}", "--shard-count", "1" |
When load Kubernetes resource aws-kinesis-client.yaml

Given load KameletBinding aws-kinesis-to-inmem.yaml
Then KameletBinding aws-kinesis-to-inmem should be available
Given load KameletBinding inmem-to-log.yaml
And KameletBinding inmem-to-log should be available
Given load Pipe aws-kinesis-to-inmem.yaml
Then Pipe aws-kinesis-to-inmem should be available
Given load Pipe inmem-to-log.yaml
And Pipe inmem-to-log should be available
And Camel K integration aws-kinesis-to-inmem is running
And Camel K integration inmem-to-log is running

Expand All @@ -37,5 +37,5 @@ Feature: AWS-Kinesis Kamelet
| aws.kinesis.clientName | aws-kinesis-client-citrus:randomString(10, LOWERCASE) |
| aws.kinesis.command | "delete-stream", "--stream-name", "${camel.kamelet.aws-kinesis-source.aws-kinesis-credentials.stream}" |
Then load Kubernetes resource aws-kinesis-client.yaml
Given delete KameletBinding inmem-to-log
Given delete KameletBinding aws-kinesis-to-inmem
Given delete Pipe inmem-to-log
Given delete Pipe aws-kinesis-to-inmem
4 changes: 2 additions & 2 deletions test/aws-kinesis/aws-kinesis-to-inmem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: KameletBinding
kind: Pipe
metadata:
name: aws-kinesis-to-inmem
spec:
Expand All @@ -34,4 +34,4 @@ spec:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: messages
name: messages
4 changes: 2 additions & 2 deletions test/aws-kinesis/aws-kinesis-uri-binding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Feature: AWS Kinesis Kamelet - binding to URI

Scenario: Create Camel K resources
Given Kamelet aws-kinesis-source is available
Given load KameletBinding aws-kinesis-uri-binding.yaml
Given KameletBinding aws-kinesis-uri-binding is available
Given load Pipe aws-kinesis-uri-binding.yaml
Given Pipe aws-kinesis-uri-binding is available
Given variable loginfo is "aws2-kinesis://${camel.kamelet.aws-kinesis-source.aws-kinesis-credentials.stream}"
Then Camel K integration aws-kinesis-uri-binding should print ${loginfo}

Expand Down
2 changes: 1 addition & 1 deletion test/aws-kinesis/aws-kinesis-uri-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: KameletBinding
kind: Pipe
metadata:
name: aws-kinesis-uri-binding
spec:
Expand Down
5 changes: 5 additions & 0 deletions test/aws-kinesis/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ config:
tags:
- "not @ignored"
settings:
loggers:
- name: INTEGRATION_STATUS
level: INFO
- name: INTEGRATION_LOGS
level: INFO
dependencies:
- groupId: org.apache.camel
artifactId: camel-aws2-kinesis
Expand Down
12 changes: 6 additions & 6 deletions test/aws-sqs/aws-sqs-inmem-binding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Feature: AWS SQS Kamelet - binding to InMemoryChannel
| aws.sqs.command | "create-queue", "--queue-name", "${camel.kamelet.aws-sqs-source.aws-sqs-credentials.queueNameOrArn}" |
When load Kubernetes resource aws-sqs-client.yaml

Given load KameletBinding aws-sqs-to-inmem.yaml
Given load KameletBinding inmem-to-log.yaml
Then KameletBinding aws-sqs-to-inmem is available
And KameletBinding inmem-to-log should be available
Given load Pipe aws-sqs-to-inmem.yaml
Given load Pipe inmem-to-log.yaml
Then Pipe aws-sqs-to-inmem is available
And Pipe inmem-to-log should be available
Then Camel K integration aws-sqs-to-inmem is running
And Camel K integration inmem-to-log is running

Expand All @@ -31,8 +31,8 @@ Feature: AWS SQS Kamelet - binding to InMemoryChannel
Then Camel K integration inmem-to-log should print "${aws.sqs.message}"

Scenario: Remove Camel K resources
Given delete KameletBinding aws-sqs-to-inmem
Given delete KameletBinding inmem-to-log
Given delete Pipe aws-sqs-to-inmem
Given delete Pipe inmem-to-log

Scenario: Remove AWS SQS queue
Given variables
Expand Down
2 changes: 1 addition & 1 deletion test/aws-sqs/aws-sqs-to-inmem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: KameletBinding
kind: Pipe
metadata:
name: aws-sqs-to-inmem
spec:
Expand Down
6 changes: 3 additions & 3 deletions test/aws-sqs/aws-sqs-uri-binding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Feature: AWS SQS Kamelet - binding to URI

Scenario: Create Camel K resources
Given Kamelet aws-sqs-source is available
Given load KameletBinding aws-sqs-uri-binding.yaml
Given KameletBinding aws-sqs-uri-binding is available
Given load Pipe aws-sqs-uri-binding.yaml
Given Pipe aws-sqs-uri-binding is available
Given variable loginfo is "Installed features"
Then Camel K integration aws-sqs-uri-binding should print ${loginfo}

Expand All @@ -27,7 +27,7 @@ Feature: AWS SQS Kamelet - binding to URI
Then Camel K integration aws-sqs-uri-binding should print "${aws.sqs.message}"

Scenario: Remove Camel K resources
Given delete KameletBinding aws-sqs-uri-binding
Given delete Pipe aws-sqs-uri-binding
Given delete Camel K integration aws-sqs-uri-binding

Scenario: Remove AWS SQS queue
Expand Down
4 changes: 2 additions & 2 deletions test/aws-sqs/aws-sqs-uri-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: KameletBinding
kind: Pipe
metadata:
name: aws-sqs-uri-binding
spec:
Expand All @@ -31,4 +31,4 @@ spec:
secretKey: ${camel.kamelet.aws-sqs-source.aws-sqs-credentials.secretKey}
region: ${camel.kamelet.aws-sqs-source.aws-sqs-credentials.region}
sink:
uri: log:info
uri: log:info
5 changes: 5 additions & 0 deletions test/aws-sqs/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ config:
tags:
- "not @ignored"
settings:
loggers:
- name: INTEGRATION_STATUS
level: INFO
- name: INTEGRATION_LOGS
level: INFO
dependencies:
- groupId: org.apache.camel
artifactId: camel-aws2-sqs
Expand Down
41 changes: 41 additions & 0 deletions test/extract-field/extract-field-action-pipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: extract-field-action-pipe
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: timer-source
properties:
period: 10000
contentType: application/json
message: >
${input}
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: extract-field-action
properties:
field: ${field}
sink:
uri: yaks:resolveURL('test-service')/result
Loading

0 comments on commit 3ea30ae

Please sign in to comment.