-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (50 loc) · 1.96 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
50
51
52
53
54
55
56
57
58
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
- 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: Update Utils.go
run: |
sed -i "s/MGMT_IP = \".*\"/MGMT_IP = \"${{ github.event.inputs.ip }}\"/" $GITHUB_WORKSPACE/e2e/utils.go
sed -i "s/CLUSTER_ID = \".*\"/CLUSTER_ID = \"${{ github.event.inputs.uuid }}\"/" $GITHUB_WORKSPACE/e2e/utils.go
sed -i "s/CLUSTER_SECRET = \".*\"/CLUSTER_SECRET = \"${{ github.event.inputs.secret }}\"/" $GITHUB_WORKSPACE/e2e/utils.go
- name: Run tests
run: make e2e-test