blob: 0112e19ecb26e1da4045af02898ccb461e819ccf [file] [log] [blame]
# ---------------------------------------------------------------------------
# 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: knative
on:
pull_request:
branches:
- main
- "release-*"
paths-ignore:
- 'proposals/**'
- '**.adoc'
- 'KEYS'
- 'LICENSE'
- 'NOTICE'
push:
branches:
- main
- "release-*"
paths-ignore:
- 'proposals/**'
- '**.adoc'
- 'KEYS'
- 'LICENSE'
- 'NOTICE'
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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 11
uses: AdoptOpenJDK/install-jdk@v1
with:
version: "11"
- name: Set Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v1
with:
node_image: kindest/node:v1.20.2
- name: Info
run: |
kubectl version
kubectl cluster-info
kubectl describe nodes
- name: Install Knative
run: |
# Prerequisites
sudo pip install yq
export SERVING_VERSION=v0.16.0
export EVENTING_VERSION=v0.16.2
export SOURCES_VERSION=v0.16.0
# Serving
kubectl apply --filename https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-crds.yaml
curl -L -s https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Kourier
kubectl apply --filename https://github.com/knative/net-kourier/releases/download/$SERVING_VERSION/kourier.yaml
kubectl patch configmap/config-network \
--namespace knative-serving \
--type merge \
--patch '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'
# Eventing
kubectl apply --filename https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-crds.yaml
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Eventing channels
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/in-memory-channel.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Eventing broker
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/mt-channel-broker.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Eventing sugar controller for injection
kubectl apply -f https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-sugar-controller.yaml
# Camel Sources
kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/$SOURCES_VERSION/camel.yaml
# Wait for installation completed
echo "Waiting for all pods to be ready in kourier-system"
kubectl wait --for=condition=Ready pod --all -n kourier-system --timeout=60s
echo "Waiting for all pods to be ready in knative-serving"
kubectl wait --for=condition=Ready pod --all -n knative-serving --timeout=60s
echo "Waiting for all pods to be ready in knative-eventing"
kubectl wait --for=condition=Ready pod --all -n knative-eventing --timeout=60s
echo "Waiting for all pods to be ready in knative-sources"
kubectl wait --for=condition=Ready pod --all -n knative-sources --timeout=60s
- name: Build Operator
run: |
echo "Build project"
export LOCAL_IMAGE=$KIND_REGISTRY/apache/camel-k
echo "LOCAL_IMAGE=${LOCAL_IMAGE}:$(make get-version)" >> $GITHUB_ENV
make IMAGE_NAME=${LOCAL_IMAGE} PACKAGE_ARTIFACTS_STRATEGY=download build package-artifacts images images-push
sudo mv ./kamel /usr/local/bin
- name: Run IT
run: |
echo "Installing camel k cluster resources"
kamel install --cluster-setup
# Configure install options
export KAMEL_INSTALL_BUILD_PUBLISH_STRATEGY=Spectrum
export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY
export KAMEL_INSTALL_REGISTRY_INSECURE=true
export KAMEL_INSTALL_OPERATOR_IMAGE=$KIND_REGISTRY/apache/camel-k:$(make get-version)
# Configure test options
export CAMEL_K_TEST_IMAGE_NAME=$KIND_REGISTRY/apache/camel-k
export CAMEL_K_TEST_IMAGE_VERSION=$(make get-version)
# Then run integration tests
make test-knative
yaks:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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 11
uses: AdoptOpenJDK/install-jdk@v1
with:
version: "11"
- name: Set Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Get YAKS
run: |
export YAKS_VERSION=0.4.0-202104120032
curl --fail -L https://github.com/citrusframework/yaks/releases/download/${YAKS_VERSION}/yaks-${YAKS_VERSION}-linux-64bit.tar.gz -o yaks.tar.gz
tar -zxf yaks.tar.gz
sudo mv yaks /usr/local/bin/
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v1
with:
node_image: kindest/node:v1.20.2
- name: Info
run: |
kubectl version
kubectl cluster-info
kubectl describe nodes
- name: Install YAKS
run: |
yaks install --cluster-setup
- name: Install Knative
run: |
# Prerequisites
sudo pip install yq
export SERVING_VERSION=v0.16.0
export EVENTING_VERSION=v0.16.2
export SOURCES_VERSION=v0.16.0
# Serving
kubectl apply --filename https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-crds.yaml
curl -L -s https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Kourier
kubectl apply --filename https://github.com/knative/net-kourier/releases/download/$SERVING_VERSION/kourier.yaml
kubectl patch configmap/config-network \
--namespace knative-serving \
--type merge \
--patch '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'
# Eventing
kubectl apply --filename https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-crds.yaml
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Eventing channels
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/in-memory-channel.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Eventing broker
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/mt-channel-broker.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
# Eventing sugar controller for injection
kubectl apply -f https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-sugar-controller.yaml
# Camel Sources
kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/$SOURCES_VERSION/camel.yaml
# Wait for installation completed
echo "Waiting for all pods to be ready in kourier-system"
kubectl wait --for=condition=Ready pod --all -n kourier-system --timeout=60s
echo "Waiting for all pods to be ready in knative-serving"
kubectl wait --for=condition=Ready pod --all -n knative-serving --timeout=60s
echo "Waiting for all pods to be ready in knative-eventing"
kubectl wait --for=condition=Ready pod --all -n knative-eventing --timeout=60s
echo "Waiting for all pods to be ready in knative-sources"
kubectl wait --for=condition=Ready pod --all -n knative-sources --timeout=60s
- name: Build Operator
run: |
echo "Build project"
export LOCAL_IMAGE=$KIND_REGISTRY/apache/camel-k
echo "LOCAL_IMAGE=${LOCAL_IMAGE}:$(make get-version)" >> $GITHUB_ENV
make IMAGE_NAME=${LOCAL_IMAGE} PACKAGE_ARTIFACTS_STRATEGY=download build package-artifacts images images-push
sudo mv ./kamel /usr/local/bin
- name: Run IT
run: |
echo "Installing camel k cluster resources"
kamel install --cluster-setup
# Configure install options
export KAMEL_INSTALL_BUILD_PUBLISH_STRATEGY=Spectrum
export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
export KAMEL_INSTALL_REGISTRY=$KIND_REGISTRY
export KAMEL_INSTALL_REGISTRY_INSECURE=true
export KAMEL_INSTALL_OPERATOR_IMAGE=$KIND_REGISTRY/apache/camel-k:$(make get-version)
# Configure test options
export CAMEL_K_TEST_IMAGE_NAME=$KIND_REGISTRY/apache/camel-k
export CAMEL_K_TEST_IMAGE_VERSION=$(make get-version)
# Install Yaks globally
yaks install
# Then run integration tests
yaks test e2e/yaks/common