-
Notifications
You must be signed in to change notification settings - Fork 43
160 lines (149 loc) · 4.5 KB
/
Copy pathe2e-test.yaml
File metadata and controls
160 lines (149 loc) · 4.5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Run e2e tests
on:
workflow_call:
inputs:
e2e-selector:
default: quick
description: "Selector for which tests to run, defaults to 'quick'"
required: true
type: string
e2e-flags:
type: string
description: "Flags to pass to chainsaw when running e2e tests"
environment:
required: false
type: string
default: ''
workflow_dispatch:
inputs:
e2e-selector:
default: quick
description: "Selector for which tests to run, defaults to 'quick'"
type: choice
required: true
options:
- quick
- flavors
- k3s
- rke2
- default-cluster
- kubeadm-full
- linodecluster
- linodemachine
- linodeobj
- linodevpc
- linodeplacementgroup
- linodefirewall
- all
e2e-flags:
type: string
description: "Flags to pass to chainsaw when running e2e tests"
permissions:
contents: read
pull-requests: read
actions: read
concurrency:
group: e2e-${{ inputs.e2e-selector }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'src' output variable
paths: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/filters.yml
e2e-test:
needs: changes
name: ${{ format('{0}-e2e-tests', inputs.e2e-selector) }}
if: ${{contains(fromJSON(needs.changes.outputs.paths), 'src')}}
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
disable-sudo: true
egress-policy: audit
allowed-endpoints: >
*:6443
api.linode.com:443
api.github.com:443
github.com:443
gcr.io:443
ghcr.io:443
proxy.golang.org:443
sum.golang.org:443
*.githubusercontent.com:443
docker.io:443
registry-1.docker.io:443
auth.docker.io:443
production.cloudflare.docker.com:443
storage.googleapis.com:443
registry.k8s.io:443
*.pkg.dev:443
*.amazonaws.com:443
*.blob.core.windows.net:443
quay.io:443
*.quay.io:443
api.snapcraft.io:443
cloud.tilt.dev:443
kubernetes-sigs.github.io:443
charts.jetstack.io:443
helm.cilium.io:443
linode.github.io:443
dl.k8s.io:443
cdn.dl.k8s.io:443
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
check-latest: true
- name: Docker cache
uses: ScribeMD/docker-cache@0.5.0
with:
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}
- name: Run E2E Test
env:
E2E_FLAGS: ${{ inputs.e2e-flags }}
E2E_SELECTOR: ${{ inputs.e2e-selector }}
INSTALL_K3S_PROVIDER: true
INSTALL_RKE2_PROVIDER: true
LINODE_REGION: us-sea
LINODE_CONTROL_PLANE_MACHINE_TYPE: g6-standard-2
LINODE_MACHINE_TYPE: g6-standard-2
CLUSTERCTL_CONFIG: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/e2e/gha-clusterctl-config.yaml
LINODE_CLIENT_TIMEOUT: 30
run: make e2etest
- name: cleanup stale clusters
if: ${{ always() }}
run: make clean-child-clusters
- name: Copy logs
if: ${{ always() }}
run: docker cp tilt-control-plane:/var/log .logs
- uses: actions/upload-artifact@v5
if: ${{ always() }}
with:
name: ${{ inputs.e2e-selector }}-logs
path: .logs/*
overwrite: true