-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (76 loc) · 2.82 KB
/
Copy pathshared-e2e.yaml
File metadata and controls
81 lines (76 loc) · 2.82 KB
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
name: Shared E2E
on:
workflow_call:
inputs:
runs-on:
description: "The runner to use for the job (must be a Linux runner; this workflow uses KinD and make)"
required: false
default: "ubuntu-latest"
type: string
greenhouse-ref:
description: "Ref (branch, tag, or SHA) of cloudoperators/greenhouse to deploy"
required: false
default: "main"
type: string
admin-k8s-version:
description: "Kubernetes node image tag for the admin KinD cluster (e.g. v1.31.0)"
required: true
type: string
remote-k8s-version:
description: "Kubernetes node image tag for the remote KinD cluster (e.g. v1.31.0)"
required: true
type: string
scenario:
description: "E2E scenario name passed to the composite action and make target"
required: true
type: string
test-target:
description: "The make target in the calling repo used to run e2e tests"
required: false
default: "e2e"
type: string
working-directory:
description: "Working directory for the make test target"
required: false
default: "."
type: string
environment:
description: "GitHub environment name to use for this job (optional)"
required: false
default: ""
type: string
jobs:
e2e:
runs-on: ${{ inputs.runs-on }}
environment: ${{ inputs.environment != '' && inputs.environment || null }}
permissions:
contents: read
steps:
- name: Validate runner
run: |
if [ "$RUNNER_OS" != "Linux" ]; then
echo "ERROR: this workflow requires a Linux runner (uses KinD and make); got: $RUNNER_OS"
exit 1
fi
- name: Run Greenhouse E2E composite action
uses: cloudoperators/common/workflows/e2e@main
with:
admin-k8s-version: ${{ inputs.admin-k8s-version }}
remote-k8s-version: ${{ inputs.remote-k8s-version }}
scenario: ${{ inputs.scenario }}
ref: ${{ inputs.greenhouse-ref }}
- name: Checkout calling repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
path: caller
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: caller/${{ inputs.working-directory != '.' && format('{0}/go.mod', inputs.working-directory) || 'go.mod' }}
cache: true
cache-dependency-path: caller/${{ inputs.working-directory != '.' && format('{0}/go.sum', inputs.working-directory) || 'go.sum' }}
- name: Run e2e tests
working-directory: caller/${{ inputs.working-directory }}
env:
TEST_TARGET: ${{ inputs.test-target }}
run: make "$TEST_TARGET"