| # --------------------------------------------------------------------------- |
| # 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: builder |
| |
| on: |
| pull_request: |
| branches: |
| - main |
| - "release-*" |
| paths-ignore: |
| - 'docs/**' |
| - 'proposals/**' |
| - '**.adoc' |
| - '**.md' |
| - 'KEYS' |
| - 'LICENSE' |
| - 'NOTICE' |
| push: |
| branches: |
| - main |
| - "release-*" |
| paths-ignore: |
| - 'docs/**' |
| - 'proposals/**' |
| - '**.adoc' |
| - '**.md' |
| - 'KEYS' |
| - 'LICENSE' |
| - 'NOTICE' |
| |
| concurrency: |
| group: ${{ github.ref }}-${{ github.workflow }} |
| cancel-in-progress: true |
| |
| jobs: |
| builder-it: |
| runs-on: ubuntu-20.04 |
| |
| strategy: |
| matrix: |
| publisher: ["Buildah", "Spectrum", "Kaniko"] |
| |
| 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 |
| 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.15.x |
| - name: Kubernetes KinD Cluster |
| uses: container-tools/kind-action@v1 |
| with: |
| version: v0.11.0 |
| node_image: kindest/node:v1.21.1@sha256:fae9a58f17f18f06aeac9772ca8b5ac680ebbed985e266f711d936e91d113bad |
| - name: Info |
| run: | |
| kubectl cluster-info |
| kubectl describe nodes |
| - 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 |
| # 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 }} |
| env: |
| KAMEL_INSTALL_BUILD_PUBLISH_STRATEGY: ${{ matrix.publisher }} |
| run: | |
| echo "Installing camel k cluster resources" |
| kamel install --cluster-setup |
| |
| # Configure install options |
| 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-builder |