-
Notifications
You must be signed in to change notification settings - Fork 145
93 lines (75 loc) · 2.61 KB
/
addon-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
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
name: Addon-test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Common versions
GO_VERSION: '1.19'
jobs:
detect-noop:
runs-on: ubuntu-latest
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
Addon-test:
name: Addon-test
runs-on: self-hosted
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install make gcc jq ca-certificates curl gnupg -y
sudo snap install kubectl --classic
sudo snap install helm --classic
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Check addon semver
run: |
make check-addon-semver
- name: Setup KinD
run: |
go install sigs.k8s.io/[email protected]
kind delete cluster --name worker || true
kind create cluster --name worker --image=kindest/node:v1.26.4
kind export kubeconfig --internal --name worker --kubeconfig /tmp/worker.kubeconfig
kind delete cluster || true
kind create cluster --image=kindest/node:v1.26.4
- name: Install vela cli
run: |
curl -fsSl https://kubevela.io/script/install.sh | bash -s v1.9.0-alpha.3
- name: Install vela core
run: |
vela install -v v1.9.0-alpha.2 --yes
kubectl get deploy -n vela-system kubevela-vela-core -oyaml
- name: Vela worker cluster join
run: |
vela cluster join /tmp/worker.kubeconfig --name worker
vela cluster list
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Addon e2e-test
run: |
go build -o main test/e2e-test/addon-test/main.go
./main ${{ steps.changed-files.outputs.all_changed_files }}