-
Notifications
You must be signed in to change notification settings - Fork 13
94 lines (78 loc) · 2.68 KB
/
e2e-tools.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI E2E - for tools
on:
pull_request:
branches:
- main
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
e2e-tools:
runs-on: ubuntu-latest
env:
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.23.3
- 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 tools test binary
run: |
make binary-e2e-tools
- name: Build tools
run: |
make build-tools binary-nrovalidate bin/mkginkgolabelfilter binary
- 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=''
- name: Deploy NUMA Resources Operator
run: |
# we only need the manifests, this happens to be the easiest way known to date
KUSTOMIZE_DEPLOY_DIR="config/kind-ci/" make deploy
- name: E2E Tests
run: |
export KUBECONFIG=${HOME}/.kube/config
kubectl create -f doc/examples/mcp.yaml
kubectl create -f doc/examples/nrop.yaml
hack/run-test-tools-e2e.sh --no-color
- 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