blob: a9933cdad638d9f09e243b7a98acc0584fbbe74a [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: kubernetes
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:
build:
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 cluster-info
kubectl describe nodes
- name: Build Operator
run: |
echo "Build project"
make build-kamel bundle-kamelets
echo "Preparing the maven overlay"
make maven-overlay
echo "Adding maven artifacts to the image context"
make PACKAGE_ARTIFACTS_STRATEGY=download package-artifacts
echo "Copying binary file to docker dir"
mkdir -p ./build/_output/bin
cp ./kamel ./build/_output/bin/
echo "Building the images"
export LOCAL_IMAGE=$KIND_REGISTRY/apache/camel-k:$(make get-version)
docker build -t "${LOCAL_IMAGE}" -f build/Dockerfile .
docker push ${LOCAL_IMAGE}
sudo mv ./kamel /usr/local/bin
- name: Run IT
# Disable registry tests as not compatible with KinD
#env:
# TEST_DOCKER_HUB_USERNAME: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
# TEST_DOCKER_HUB_PASSWORD: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
# TEST_GITHUB_PACKAGES_REPO: ${{ secrets.TEST_GITHUB_PACKAGES_REPO }}
# TEST_GITHUB_PACKAGES_USERNAME: ${{ secrets.TEST_GITHUB_PACKAGES_USERNAME }}
# TEST_GITHUB_PACKAGES_PASSWORD: ${{ secrets.TEST_GITHUB_PACKAGES_PASSWORD }}
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-integration