-
Notifications
You must be signed in to change notification settings - Fork 22
101 lines (92 loc) · 4.57 KB
/
e2e.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
95
96
97
98
99
100
101
on:
workflow_call:
inputs:
e2e-labels:
description: Labels to filter e2e tests
type: string
required: true
make-target:
description: Make target to run
type: string
required: true
jobs:
e2e-test:
runs-on:
- self-hosted-ncn-dind
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
# Install nix using cachix/install-nix-action if running on ARC runners
# See: https://github.com/DeterminateSystems/nix-installer-action/issues/68
- name: Install Nix on self-hosted ARC runners
uses: cachix/install-nix-action@V27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.11.0
with:
enable-cache: "false"
skip-nix-installation: "true"
- uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get Control Plane endpoint IP
id: get-control-plane-endpoint-ip
run: |
export CONTROL_PLANE_ENDPOINT_RANGE_START="${{ vars.CONTROL_PLANE_ENDPOINT_RANGE_START }}"
export CONTROL_PLANE_ENDPOINT_RANGE_END="${{ vars.CONTROL_PLANE_ENDPOINT_RANGE_END }}"
control_plane_endpoint_ip="$(devbox run -- make nutanix-cp-endpoint-ip)"
echo "control_plane_endpoint_ip=${control_plane_endpoint_ip}" >> "${GITHUB_OUTPUT}"
- name: Check Control Plane endpoint IP
run: |
if [[ -z "${{ steps.get-control-plane-endpoint-ip.outputs.control_plane_endpoint_ip }}" ]]; then
echo "control_plane_endpoint_ip is empty; cannot proceed with e2e tests"
exit 1
fi
- name: Get Control Plane endpoint IP for clusterctl upgrade test
id: get-control-plane-endpoint-ip-clusterctl-upgrade
run: |
export CONTROL_PLANE_ENDPOINT_RANGE_START="${{ vars.CONTROL_PLANE_ENDPOINT_RANGE_START }}"
export CONTROL_PLANE_ENDPOINT_RANGE_END="${{ vars.CONTROL_PLANE_ENDPOINT_RANGE_END }}"
control_plane_endpoint_ip="$(devbox run -- make nutanix-cp-endpoint-ip)"
echo "control_plane_endpoint_ip_clusterctl_upgrade=${control_plane_endpoint_ip}" >> "${GITHUB_OUTPUT}"
- name: Check Control Plane endpoint IP for clusterctl upgrade
run: |
if [[ -z "${{ steps.get-control-plane-endpoint-ip-clusterctl-upgrade.outputs.control_plane_endpoint_ip_clusterctl_upgrade }}" ]]; then
echo "control_plane_endpoint_ip_clusterctl_upgrade is empty; cannot proceed with e2e tests"
exit 1
fi
- name: Login to Internal Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.LOCAL_IMAGE_REGISTRY }}
username: ${{ secrets.LOCAL_IMAGE_REGISTRY_USERNAME }}
password: ${{ secrets.LOCAL_IMAGE_REGISTRY_TOKEN }}
- name: Test build
run: devbox run -- make ${{ inputs.make-target }} LABEL_FILTERS='${{ inputs.e2e-labels }}'
env:
NUTANIX_USER: ${{ secrets.NUTANIX_USER }}
NUTANIX_PASSWORD: ${{ secrets.NUTANIX_PASSWORD }}
NUTANIX_ENDPOINT: ${{ secrets.NUTANIX_ENDPOINT }}
NUTANIX_PRISM_ELEMENT_CLUSTER_IP: ${{ secrets.NUTANIX_PRISM_ELEMENT_CLUSTER_IP }}
NUTANIX_PRISM_ELEMENT_CLUSTER_USERNAME: ${{ secrets.NUTANIX_PRISM_ELEMENT_CLUSTER_USERNAME }}
NUTANIX_PRISM_ELEMENT_CLUSTER_PASSWORD: ${{ secrets.NUTANIX_PRISM_ELEMENT_CLUSTER_PASSWORD }}
LOCAL_IMAGE_REGISTRY: ${{ secrets.LOCAL_IMAGE_REGISTRY }}
WEBHOOK_KEY: ${{ secrets.WEBHOOK_KEY }}
WEBHOOK_CERT: ${{ secrets.WEBHOOK_CERT }}
WEBHOOK_CA: ${{ secrets.WEBHOOK_CA }}
NUTANIX_SSH_AUTHORIZED_KEY: ${{ secrets.NUTANIX_SSH_AUTHORIZED_KEY }}
NUTANIX_PRISM_ELEMENT_CLUSTER_NAME: ${{ vars.NUTANIX_PRISM_ELEMENT_CLUSTER_NAME }}
NUTANIX_SUBNET_NAME: ${{ vars.NUTANIX_SUBNET_NAME }}
NUTANIX_ADDITIONAL_SUBNET_NAME: ${{ vars.NUTANIX_ADDITIONAL_SUBNET_NAME }}
NUTANIX_PROJECT_NAME: ${{ vars.NUTANIX_PROJECT_NAME }}
CONTROL_PLANE_ENDPOINT_IP: ${{ steps.get-control-plane-endpoint-ip.outputs.control_plane_endpoint_ip }}
CONTROL_PLANE_ENDPOINT_IP_WORKLOAD_CLUSTER: ${{ steps.get-control-plane-endpoint-ip-clusterctl-upgrade.outputs.control_plane_endpoint_ip_clusterctl_upgrade }}