-
Notifications
You must be signed in to change notification settings - Fork 16
120 lines (115 loc) · 4.32 KB
/
e2e-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
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
name: E2E Test
on:
push:
tags:
- v*
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
workflow_dispatch: { }
jobs:
build-artifact:
env:
VELAUX_VERSION_KEY: github.com/oam-dev/velad/version.VelaUXVersion
runs-on: ubuntu-22.04
strategy:
matrix:
TARGETS: [ linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64 ]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: actions/setup-go@v3
with:
go-version: "1.20.5"
- name: Get matrix
id: get_matrix
shell: bash
run: |
TARGETS=${{matrix.TARGETS}}
echo "OS=${TARGETS%/*}" >> $GITHUB_OUTPUT
echo "ARCH=${TARGETS#*/}" >> $GITHUB_OUTPUT
- name: Build
run: |
make ${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: bin/velad-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
name: velad-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}
test-linux:
runs-on: ubuntu-22.04
needs: [ build-artifact ]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: actions/setup-go@v3
with:
go-version: "1.20.5"
- name: Install ginkgo
run: go install github.com/onsi/ginkgo/[email protected]
- uses: actions/download-artifact@v3
with:
name: velad-linux-amd64
- run: |
chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad
sudo ./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
sudo chmod a+r $(./velad kubeconfig --host)
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core --timeout=180s -n vela-system --kubeconfig=$(./velad kubeconfig --host)
sudo vela addon enable /root/.vela/addons/velaux
- name: Run e2e test
run: ginkgo -v ./test/e2e-test
test-darwin:
runs-on: macos-12
needs: [ build-artifact ]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: actions/setup-go@v3
with:
go-version: "1.20.5"
- name: Install ginkgo
run: go install github.com/onsi/ginkgo/[email protected]
- uses: actions/download-artifact@v3
with:
name: velad-darwin-amd64
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master
with:
docker_version: "24.0.2"
- run: |
chmod u+x velad-darwin-amd64 && mv velad-darwin-amd64 velad
./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
export KUBECONFIG=$(./velad kubeconfig --host)
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core --timeout=180s -n vela-system
vela addon enable ~/.vela/addons/velaux
# TODO(qiaozp): fix the issue of e2e test on darwin
# - name: Run e2e test
# run: ginkgo -v ./test/e2e-test
# test-linux-arm64:
# runs-on: ubuntu-22.04
# needs: [ build-artifact ]
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: velad-darwin-amd64
# - run: chmod u+x velad-linux-amd64 && mv velad-linux-amd64 velad
# - name: pguyot/arm-runner-action@v2
# with:
# commands: |
# sudo ./velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never
# sudo vela def list
# test-windows:
# runs-on: windows-2022
# needs: [ build-artifact ]
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: velad-windows-amd64
# - name: Setup Docker
# uses: docker-practice/actions-setup-docker@master
# - run: chmod u+x velad-windows-amd64 && mv velad-windows-amd64 velad.exe
# - run: .\velad install --set image.pullPolicy=Never --set admissionWebhooks.patch.image.pullPolicy=Never --set multicluster.clusterGateway.image.pullPolicy=Never