Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow dispatch #12

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: SPDK E2E TEST

on:
workflow_dispatch:
inputs:
uuid:
description: ''
required: true
default: '79276661-5f8a-405d-ab6d-651b88326206'
ip:
description: ''
required: true
default: '18.218.243.112'
secret:
description: ''
required: true
default: '8K9BVlNfYo6aiLamu1c2'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

- name: Authenticate with Kubernetes cluster
run: |
mkdir -p "${HOME}/.kube"
echo ${{ secrets.KUBE_CONFIG_DATA }} | base64 --decode > ${HOME}/.kube/config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubeconfig data also changes for a new cluster. You might also have to take kubeconfig from the workflow dispatch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think leaving it as a secret is much better as it needs to be treated as one.
It is easily updated by changing the secret value with the new kubeconfig

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we have to update the secret every time you run the e2e tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't.
we only update it if the cluster we are testing on changes.


- name: Update ConfigMap
run: |
sed -i "s/\"uuid\": \".*\"/\"uuid\": \"${{ github.event.inputs.uuid }}\"/" $GITHUB_WORKSPACE/deploy/kubernetes/config-map.yaml
sed -i "s/\"ip\": \".*\"/\"ip\": \"${{ github.event.inputs.ip }}\"/" $GITHUB_WORKSPACE/deploy/kubernetes/config-map.yaml

- name: Update Secret
run: |
sed -i "s/\"secret\": \".*\"/\"secret\": \"${{ github.event.inputs.secret }}\"/" $GITHUB_WORKSPACE/deploy/kubernetes/secret.yaml

- name: Run tests
run: make e2e-test
Loading