forked from apecloud/apecloud-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (150 loc) · 4.55 KB
/
cloud-test-k3s.yml
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
161
162
name: Cloud E2E Test on K3S GCP
on:
workflow_call:
inputs:
APECLOUD_VERSION:
description: 'ApeCloud release version'
type: string
required: false
default: 'v0.3.5'
KUBEBLOCKS_VERSION:
description: 'kubeblocks release version'
type: string
required: false
default: 'latest'
K3S_VERSION:
description: 'k8s cluster version (e.g. 1.26)'
type: string
required: false
default: '1.26'
APECLOUD_BRANCH:
description: 'apecloud branch name'
type: string
required: false
default: 'main'
TESTINFRA_BRANCH:
description: 'testinfra branch name'
type: string
required: false
default: 'main'
E2ETEST_BRANCH:
description: 'e2etest branch name'
type: string
required: false
default: 'main'
APECD_REF:
description: "The branch name of apecloud-cd"
type: string
required: false
default: 'main'
ARGS:
description: "Test args"
type: string
required: false
default: ''
workflow_dispatch:
inputs:
APECLOUD_VERSION:
description: 'ApeCloud release version'
type: string
required: false
default: 'v0.3.5'
KUBEBLOCKS_VERSION:
description: 'kubeblocks release version'
type: string
required: false
default: 'latest'
K3S_VERSION:
description: 'k8s cluster version (e.g. 1.26)'
type: string
required: false
default: '1.26'
APECLOUD_BRANCH:
description: 'apecloud branch name'
type: string
required: false
default: 'main'
TESTINFRA_BRANCH:
description: 'testinfra branch name'
type: string
required: false
default: 'main'
E2ETEST_BRANCH:
description: 'e2etest branch name'
type: string
required: false
default: 'main'
APECD_REF:
description: "The branch name of apecloud-cd"
type: string
required: false
default: 'main'
ARGS:
description: "Test args"
type: string
required: false
default: ''
run-name: ApeCloud:${{ inputs.APECLOUD_VERSION }} K3S:${{ inputs.K3S_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
permissions:
id-token: write
contents: read
jobs:
enable-gke-runner:
uses: ./.github/workflows/enable-gke-runner.yml
with:
GITHUB_REPO: "${{ github.repository }}"
RUNNER_NAMESPACE: "default"
RUNNER_LABEL: "k3d-runner"
secrets: inherit
e2e-test:
needs: [ enable-gke-runner ]
uses: ./.github/workflows/test-cloud-k3s.yml
with:
release-version: ${{ inputs.APECLOUD_VERSION }}
kubeblocks-version: ${{ inputs.KUBEBLOCKS_VERSION }}
test-type: "0"
test-type-name: "e2e-test"
test-args: ${{ inputs.ARGS }}
k3s-version: ${{ inputs.K3S_VERSION }}
testinfra-branch: ${{ inputs.TESTINFRA_BRANCH }}
apecloud-branch: ${{ inputs.APECLOUD_BRANCH }}
e2etest-branch: ${{ inputs.E2ETEST_BRANCH }}
secrets: inherit
send-message:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [ e2e-test ]
steps:
- uses: actions/checkout@v4
with:
repository: apecloud/apecloud-cd
path: ./
ref: ${{ inputs.APECD_REF }}
- name: send message
id: get_trigger_mode
run: |
TEST_RESULT="deploy-cloud|${{ needs.e2e-test.outputs.deploy-result }}"
TEST_RESULT="${TEST_RESULT}##e2e-test|${{ needs.e2e-test.outputs.test-result }}"
TEST_RESULT=$( bash .github/utils/utils.sh --type 12 \
--github-repo "${{ github.repository }}" \
--github-token "${{ env.GITHUB_TOKEN }}" \
--test-result "${TEST_RESULT}" \
--run-id "$GITHUB_RUN_ID" )
date_ret=$(date +%Y-%m-%d-%T)
test_title="[${{ inputs.APECLOUD_VERSION }}] Test ApeCloud on K3S:${{ inputs.K3S_VERSION }} [${date_ret}]"
python3 .github/utils/send_mesage.py \
--url ${{ vars.TEST_BOT_WEBHOOK }} \
--title "$test_title" \
--result "$TEST_RESULT"
disable-gke-runner:
if: ${{ always() }}
needs: [ enable-gke-runner, send-message ]
uses: ./.github/workflows/enable-gke-runner.yml
with:
GITHUB_REPO: "${{ github.repository }}"
RUNNER_NAMESPACE: "default"
RUNNER_LABEL: "k3d-runner"
ENABLE: "disable"
secrets: inherit