Skip to content

gh actions: bump setup-go, fix inconsistent naming #7

gh actions: bump setup-go, fix inconsistent naming

gh actions: bump setup-go, fix inconsistent naming #7

Workflow file for this run

name: CI E2E
on:
pull_request:
branches:
- main
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+"
defaults:
run:
shell: bash
jobs:
e2e:
runs-on: ubuntu-20.04
env:
built_image: "numaresources-operator:ci" # Arbitrary name
E2E_NAMESPACE_NAME: numaresources
LOG_DIR: /tmp/test_e2e_logs
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Set up golang
uses: actions/setup-go@v5
with:
go-version: 1.22.4
- name: Verify modules
run: go mod verify
- name: Reuse kustomize from the host
run: |
if kustomize version | grep -Eq 'v4\.5'; then mkdir -p bin/ && ln -s $(which kustomize) bin/kustomize; fi
- name: build test binary
run: |
make build-tools-all binary-e2e-rte binary-e2e-install binary-e2e-uninstall bin/catkubeletconfmap
ls -lh bin/
- name: Build image
run: |
docker build . -t ${built_image}
- name: Create K8s Kind Cluster
run: |
# kind is part of 20.04 image, see relevant READMEs in https://github.com/actions/virtual-environments/tree/main/images/linux
kind version
kind create cluster --config=hack/kind-config-e2e-no-registry.yaml --image kindest/node:v1.30.4@sha256:976ea815844d5fa93be213437e3ff5754cd599b040946b5cca43ca45c2047114
kubectl label node kind-worker node-role.kubernetes.io/worker=''
kind load docker-image ${built_image}
- name: Deploy NUMA Resources Operator
run: |
IMG=${built_image} KUSTOMIZE_DEPLOY_DIR="config/kind-ci/" make deploy
- name: E2E Tests
run: |
export KUBECONFIG=${HOME}/.kube/config
bin/catkubeletconfmap --wait 2m --namespace ${E2E_NAMESPACE_NAME} --prefix 'E2E_' >> $GITHUB_ENV
make test-e2e
- name: Export E2E Tests logs
if: ${{ failure() }}
run: |
mkdir -p ${LOG_DIR}
for pod in $(kubectl get pods -n $E2E_NAMESPACE_NAME --no-headers=true -o custom-columns=NAME:.metadata.name)
do
oc logs $pod -n $E2E_NAMESPACE_NAME --all-containers=true > ${LOG_DIR}/${pod}.log
oc describe pod $pod -n $E2E_NAMESPACE_NAME > ${LOG_DIR}/${pod}.describe.log
done
- name: Archive E2E Tests logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test_e2e_logs
path: ${LOG_DIR}/
- name: Export kind logs
if: ${{ failure() }}
run: |
kind export logs /tmp/kind_logs
- name: Archive kind logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: kind_logs
path: /tmp/kind_logs