14
14
focus :
15
15
description : e2e tests to focus
16
16
type : string
17
+ runs-on :
18
+ description : The runner to run the e2e tests on
19
+ type : string
20
+ required : true
17
21
18
22
jobs :
19
23
e2e-test :
20
- runs-on : ubuntu-22.04
24
+ runs-on : ${{ inputs.runs-on }}
21
25
permissions :
22
26
contents : read
23
27
checks : write
@@ -27,41 +31,65 @@ jobs:
27
31
with :
28
32
fetch-depth : 0
29
33
30
- - name : Install devbox
31
- uses : jetify-com/[email protected]
34
+ - uses : cachix/install-nix-action@V27
35
+ if : inputs.provider == 'Nutanix'
32
36
with :
33
- enable-cache : true
37
+ github_access_token : ${{ secrets.GITHUB_TOKEN }}
34
38
35
- - name : Go cache
36
- uses : actions/cache@v4
39
+ - name : Install devbox
40
+ uses :
jetify-com/[email protected]
37
41
with :
38
- path : |
39
- ~/.cache/go-build
40
- ~/go/pkg/mod
41
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
42
- restore-keys : |
43
- ${{ runner.os }}-go-
42
+ enable-cache : " true"
43
+ skip-nix-installation : ${{ inputs.provider == 'Nutanix' }}
44
44
45
45
# The default disk size of these runners is ~14GB, this is not enough to run the e2e tests.
46
46
# Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840.
47
47
- name : Cleanup Disk Space
48
+ if : inputs.runs-on != 'self-hosted-ncn-dind'
48
49
run : |
49
50
echo "Before removing files:"
50
51
df -h
51
52
sudo rm -rf /usr/share/dotnet
52
53
sudo rm -rf /opt/ghc
53
54
sudo rm -rf "/usr/local/share/boost"
54
- sudo rm -rf "$AGENT_TOOLSDIRECTORY"
55
+ sudo rm -rf "${ AGENT_TOOLSDIRECTORY} "
55
56
echo "After removing files:"
56
57
df -h
57
58
59
+ - name : Get Control Plane endpoint IP
60
+ id : get-control-plane-endpoint-ip
61
+ if : inputs.provider == 'Nutanix'
62
+ run : |
63
+ CONTROL_PLANE_ENDPOINT_RANGE_START="${{ secrets.NUTANIX_CONTROL_PLANE_ENDPOINT_RANGE_START }}"
64
+ CONTROL_PLANE_ENDPOINT_RANGE_END="${{ secrets.NUTANIX_CONTROL_PLANE_ENDPOINT_RANGE_END }}"
65
+ control_plane_endpoint_ip="$(devbox run -- fping -g -u "${CONTROL_PLANE_ENDPOINT_RANGE_START}" "${CONTROL_PLANE_ENDPOINT_RANGE_END}" 2>/dev/null | devbox run -- shuf --head-count=1)"
66
+ echo "control_plane_endpoint_ip=${control_plane_endpoint_ip}" >> "${GITHUB_OUTPUT}"
67
+ - name : Go cache
68
+ uses : actions/cache@v4
69
+ with :
70
+ path : |
71
+ ~/.cache/go-build
72
+ ~/go/pkg/mod
73
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
74
+ restore-keys : |
75
+ ${{ runner.os }}-go-
76
+
58
77
- name : Run e2e tests
59
78
run : devbox run -- make e2e-test E2E_LABEL='provider:${{ inputs.provider }}' E2E_SKIP='${{ inputs.skip }}' E2E_FOCUS='${{ inputs.focus }}'
60
79
env :
61
80
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
81
+ DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
82
+ DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_HUB_PASSWORD }}
62
83
NUTANIX_ENDPOINT : ${{ secrets.NUTANIX_ENDPOINT }}
63
- NUTANIX_PASSWORD : ${{ secrets.NUTANIX_PASSWORD }}
64
84
NUTANIX_USER : ${{ secrets.NUTANIX_USER }}
85
+ NUTANIX_PASSWORD : ${{ secrets.NUTANIX_PASSWORD }}
86
+ NUTANIX_PORT : ${{ vars.NUTANIX_PORT }}
87
+ NUTANIX_INSECURE : ${{ vars.NUTANIX_INSECURE }}
88
+ NUTANIX_PRISM_ELEMENT_CLUSTER_NAME : ${{ vars.NUTANIX_PRISM_ELEMENT_CLUSTER_NAME }}
89
+ NUTANIX_SUBNET_NAME : ${{ vars.NUTANIX_SUBNET_NAME }}
90
+ NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME : ${{ vars.NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME }}
91
+ NUTANIX_STORAGE_CONTAINER_NAME : ${{ vars.NUTANIX_STORAGE_CONTAINER_NAME }}
92
+ CONTROL_PLANE_ENDPOINT_IP : ${{ steps.get-control-plane-endpoint-ip.outputs.control_plane_endpoint_ip }}
65
93
66
94
- if : success() || failure() # always run even if the previous step fails
67
95
name : Publish e2e test report
71
99
check_name : ' e2e test report'
72
100
detailed_summary : true
73
101
require_passed_tests : true
102
+
103
+ - if : success() || failure() # always run even if the previous step fails
104
+ name : Upload e2e test artifacts
105
+ uses : actions/upload-artifact@v4
106
+ with :
107
+ if-no-files-found : warn
108
+ overwrite : false
109
+ name : ${{ inputs.provider }} ${{ inputs.focus }} e2e artifacts
110
+ path : |
111
+ _artifacts
0 commit comments