-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (97 loc) · 3.8 KB
/
e2e.yml
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
102
103
104
105
# Copyright 2024 Nutanix. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
on:
workflow_call:
inputs:
provider:
description: Infrastructure provider to run e2e tests with
type: string
required: true
skip:
description: e2e tests to skip
type: string
focus:
description: e2e tests to focus
type: string
runs-on:
description: The runner to run the e2e tests on
type: string
required: true
kubernetes-version:
description: The version of Kubernetes to test with
type: string
required: true
os-image:
description: The OS image to use for the machine template
type: string
required: false
jobs:
e2e-test:
runs-on: ${{ inputs.runs-on }}
permissions:
contents: read
checks: write
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
# 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@v30
if: inputs.runs-on == 'self-hosted-ncn-dind'
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.11.0
with:
enable-cache: ${{ inputs.runs-on != 'self-hosted-ncn-dind' }}
skip-nix-installation: ${{ inputs.runs-on == 'self-hosted-ncn-dind' }}
- name: Go cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# The default disk size of Github hosted runners is ~14GB, this is not enough to run the e2e tests.
# Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840.
- name: Cleanup Disk Space
if: inputs.runs-on != 'self-hosted-ncn-dind'
run: |
echo "Before removing files:"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "${AGENT_TOOLSDIRECTORY}"
echo "After removing files:"
df -h
- name: Run e2e tests
run: devbox run -- make e2e-test E2E_LABEL='provider:${{ inputs.provider }}' E2E_SKIP='${{ inputs.skip }}' E2E_FOCUS='${{ inputs.focus }}' E2E_VERBOSE=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
NUTANIX_ENDPOINT: ${{ secrets.NUTANIX_ENDPOINT }}
NUTANIX_USER: ${{ secrets.NUTANIX_USER }}
NUTANIX_PASSWORD: ${{ secrets.NUTANIX_PASSWORD }}
NUTANIX_PORT: ${{ vars.NUTANIX_PORT }}
NUTANIX_INSECURE: false
NUTANIX_PRISM_ELEMENT_CLUSTER_NAME: ${{ vars.NUTANIX_PRISM_ELEMENT_CLUSTER_NAME }}
NUTANIX_SUBNET_NAME: ${{ vars.NUTANIX_SUBNET_NAME }}
NUTANIX_STORAGE_CONTAINER_NAME: ${{ vars.NUTANIX_STORAGE_CONTAINER_NAME }}
NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME: ${{ inputs.os-image }}
KINDEST_IMAGE_TAG: ${{ inputs.kubernetes-version }}
E2E_KUBERNETES_VERSION: ${{ inputs.kubernetes-version }}
- if: success() || failure() # always run even if the previous step fails
name: Publish e2e test report
uses: mikepenz/action-junit-report@v5
with:
report_paths: 'junit-e2e.xml'
check_name: 'e2e test report'
detailed_summary: true
require_passed_tests: true