This is an automated email from the ASF dual-hosted git repository.

ricardozanini pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-serverless-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new 0970799  Fix #259 - Update GHA to follow Apache policies (#260)
0970799 is described below

commit 0970799113e80e5b5a2083bf7d46be97bcfbfdd0
Author: Ricardo Zanini <[email protected]>
AuthorDate: Thu Sep 21 12:19:21 2023 -0300

    Fix #259 - Update GHA to follow Apache policies (#260)
    
    * Fix #259 - Update GHA to follow Apache policies
    
    Signed-off-by: Ricardo Zanini <[email protected]>
    
    * Fix container checks, replace install path to use runner
    
    Signed-off-by: Ricardo Zanini <[email protected]>
    
    * Fix container-builder checks
    
    Signed-off-by: Ricardo Zanini <[email protected]>
    
    ---------
    
    Signed-off-by: Ricardo Zanini <[email protected]>
---
 .github/workflows/check-container-builder.yml | 30 ++++----------
 .github/workflows/checks.yml                  |  4 --
 .github/workflows/e2e.yml                     | 23 ++++++-----
 hack/ci/install-minikube.sh                   | 56 +++++++++++++++++++++++++++
 4 files changed, 77 insertions(+), 36 deletions(-)

diff --git a/.github/workflows/check-container-builder.yml 
b/.github/workflows/check-container-builder.yml
index b5d09d5..5fcafb4 100644
--- a/.github/workflows/check-container-builder.yml
+++ b/.github/workflows/check-container-builder.yml
@@ -36,7 +36,9 @@ jobs:
         uses: actions/checkout@v2
         with:
           fetch-depth: 0
-      - run: make test
+      - run: |
+          cd container-builder
+          make test
 
   integration-tests:
     needs: unit-tests
@@ -54,16 +56,11 @@ jobs:
     runs-on: ubuntu-22.04
     steps:
       - name: Install packages
-        uses: awalsh128/cache-apt-pkgs-action@latest
-        with:
-          packages: libbtrfs-dev libgpgme-dev libdevmapper-dev
-          version: 1.0
-      - name: Install Podman 4.3.1
         run: |
-          wget 
http://security.ubuntu.com/ubuntu/pool/main/s/shadow/libsubid4_4.11.1+dfsg1-2ubuntu1.1_amd64.deb
-          sudo dpkg -i libsubid4_4.11.1+dfsg1-2ubuntu1.1_amd64.deb
-          wget 
http://ftp.us.debian.org/debian/pool/main/libp/libpod/podman_4.4.0+ds1-1_amd64.deb
-          sudo dpkg -i podman_4.4.0+ds1-1_amd64.deb
+          sudo apt-get -y install \
+          libgpgme-dev \
+          libbtrfs-dev \
+          libdevmapper-dev
       - name: Setup golang
         uses: actions/setup-go@v2
         with:
@@ -72,20 +69,7 @@ jobs:
         uses: actions/checkout@v2
         with:
           fetch-depth: 0
-      - name: Display Podman info
-        run: podman info
-      - name: Start Podman socket
-        run: |
-          systemctl --user start podman.socket
-          systemctl --user status podman.socket
       - name: Run integration tests
         run: |
-          mkdir -p ~/.config/systemd/user/podman.service.d/
-          printf "[Service]\nExecStart=\nExecStart=/usr/bin/podman $LOGGING 
system service -t 
0\nDelegate=true\nType=exec\nKillMode=process\nEnvironment=LOGGING="--log-level=info"\n"
 > ~/.config/systemd/user/podman.service.d/override.conf
-          systemctl --user daemon-reload
-          systemctl --user start podman.service
-          pid=$(systemctl --user show podman.service  | grep ^MainPID | sed -e 
's|MainPID=||')
-          sudo prlimit --pid $pid --nofile=262144:262144
-          sudo prlimit --pid $$ --nofile=262144:262144
           cd container-builder
           make ${{ matrix.container-engine }}-integration-test
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 628a8a7..f5ea347 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -47,10 +47,6 @@ jobs:
       - name: Run tests
         run: make test test-workflowproj
 
-      - uses: shogo82148/actions-goveralls@v1
-        with:
-          path-to-profile: cover.out
-
   check-headers:
     concurrency:
       group: sonataflow-operator-check-headers-${{ github.head_ref }}
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index db1d1b5..249d853 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -17,6 +17,7 @@ env:
   # 
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md
   # WARNING: kindest/node is not always existing with given version ...
   KUBERNETES_VERSION: v1.26.3
+  MINIKUBE_VERSION: v1.31.1
   DEBUG: true
 
 jobs:
@@ -48,16 +49,20 @@ jobs:
           go-version: ${{ env.GO_VERSION }}
           cache: true
 
-      - name: Setup Minikube cluster
-        # Should be set back with correct version once 
https://github.com/radtriste/setup-minikube/tree/issue_49 is done
-        uses: medyagh/[email protected]
+      - name: Cache Minikube Download
+        id: cache-minikube-download
+        uses: actions/cache@v3
         with:
-          addons: registry,metrics-server
-          kubernetes-version: ${{ env.KUBERNETES_VERSION }}
-          # 
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
-          cpus: max
-          memory: max
-          insecure-registry: localhost:5000,192.168.0.0/16
+          key: ${{ runner.os }}-minikube-${{ env.MINIKUBE_VERSION }}
+          path: |
+            ~/.minikube/download/
+
+      - name: Setup Minikube cluster
+        run: |
+          # Install minikube at $HOME/.local/bin
+          ./hack/ci/install-minikube.sh $HOME/.local/bin
+          echo "$HOME/.local/bin" >> $GITHUB_PATH
+          minikube start --kubernetes-version ${{ env.KUBERNETES_VERSION }} 
--addons=registry --insecure-registry=localhost:5000,192.168.0.0/16 --cpus=max 
--memory=max
       
       - name: Wait for Minikube up and running
         run: |
diff --git a/hack/ci/install-minikube.sh b/hack/ci/install-minikube.sh
new file mode 100755
index 0000000..f2905ba
--- /dev/null
+++ b/hack/ci/install-minikube.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# Copyright 2023 Red Hat, Inc. and/or its affiliates
+#
+# Licensed 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.
+
+set -e
+
+install_path=$1
+default_minikube_version=v1.31.1
+
+if [[ -z ${MINIKUBE_VERSION} ]]; then
+  MINIKUBE_VERSION=$default_minikube_version
+fi
+
+download_path="${HOME}/.minikube/download/"
+
+echo "---> Minikube version to install is ${MINIKUBE_VERSION}"
+
+# get the arch and os
+arch=$(uname -m)
+case $(uname -m) in
+"x86_64") arch="amd64" ;;
+"aarch64") arch="arm64" ;;
+esac
+os=$(uname | awk '{print tolower($0)}')
+
+if [ -e "${download_path}/minikube-${os}-${arch}" ]; then
+  echo "---> Minikube ${MINIKUBE_VERSION} (OS ${os} Architecture ${arch}) 
already exists in '${download_path}', skipping downloading"
+else
+  mkdir -p "${download_path}"
+  cd "${download_path}"
+  echo "---> Downloading minikube ${MINIKUBE_VERSION} (OS ${os} Architecture 
${arch}) to ${download_path}"
+  curl -LO 
"https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-${os}-${arch}";
+  cd -
+fi
+
+if [ -z "${install_path}" ]; then
+  install_path="${HOME}/runner/bin"
+  [[ "${os}" == "darwin" ]]; install_path="${HOME}/runner/bin"
+fi
+
+echo "---> Ensuring minikube installation at ${install_path}"
+
+mkdir -p "${install_path}"
+chmod +x "${install_path}"
+cp "${download_path}/minikube-${os}-${arch}" "${install_path}/minikube"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to