gh actions: bump setup-go, fix inconsistent naming #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 binary-e2e-rte binary-e2e-install binary-e2e-uninstall | |
- 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.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb | |
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/catkubeletconfigmap --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 |