-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.27 KB
/
test.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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test E2E
on:
# Manual Trigger
workflow_dispatch: {}
# Run on any PR that changes this pipeline or that should ultimately trigger a release when merged
pull_request:
paths:
- ".github/workflows/test.yaml"
- "go.mod"
- "go.sum"
- "**/**.go"
env:
KUBECONFIG_DIR: ./configs/
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build `kube-switcher`
run: go build -o kube-switcher
- name: Install `kind`
run: go install sigs.k8s.io/[email protected]
- name: Set Up Kubernetes Clusters
run: |
kind create cluster --name=test-cluster-1 --kubeconfig=./configs/cluster1.yaml &
kind create cluster --name=test-cluster-2 --kubeconfig=./configs/cluster2.yaml &
wait
- name: Run kube-switcher - switch to cluster 1
run: ./kube-switcher test-cluster-1
- name: List Kubernetes Nodes
run: kubectl get nodes
- name: Run kube-switcher - switch to cluster 2
run: ./kube-switcher test-cluster-2
- name: List Kubernetes Nodes
run: kubectl get nodes