-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
230e4ee
commit bd5af05
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
# 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: | ||
TALOSCONFIG_DIR: ./configs/ | ||
TALSWITCHER_LOG_LEVEL: debug | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: Build `talswitcher` | ||
run: go build -o talswitcher | ||
|
||
- name: Install `talosctl` | ||
run: curl -sL https://talos.dev/install | sh | ||
|
||
- name: Set Up Talos Clusters | ||
run: | | ||
talosctl cluster create --name=test-cluster-1 --talosconfig=./configs/talos1.yaml --cidr=10.5.0.0/24 & | ||
talosctl cluster create --name=test-cluster-2 --talosconfig=./configs/talos2.yaml --cidr=10.6.0.0/24 & | ||
wait | ||
- name: Run talswitcher - switch to cluster 1 | ||
run: ./talswitcher test-cluster-1 | ||
|
||
- name: List Talos Members | ||
run: talosctl get members -n test-cluster-1-controlplane-1 | ||
|
||
- name: Run talswitcher - switch to cluster 2 | ||
run: ./talswitcher test-cluster-2 | ||
|
||
- name: List Talos Members | ||
run: talosctl get members -n test-cluster-2-controlplane-1 | ||
|
||
- name: Try to List Members of Cluster 1 | ||
run: talosctl get members -n test-cluster-1-controlplane-1 && exit 1 || echo "This was supposed to fail!" |