-
Notifications
You must be signed in to change notification settings - Fork 119
107 lines (106 loc) · 4.09 KB
/
test-e2e-create-module.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
name: TestSuite E2E - create module
on:
push:
branches:
- main
- 'release-**'
pull_request:
branches:
- main
- 'release-**'
jobs:
e2e:
strategy:
matrix:
e2e-test: [ "test-kubebuilder-module-creation", "test-moduleconfig-module-creation",
"test-same-version-module-creation"]
name: "Run E2E tests"
runs-on: ubuntu-latest
env:
K3D_VERSION: v5.4.7
MODULE_TEMPLATE_VERSION: 1.0.0
OCI_REPOSITORY_URL: http://k3d-oci.localhost:5001
steps:
- name: Checkout Kyma CLI
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Build Kyma CLI
run: |
make resolve validate build-linux
chmod +x ./bin/kyma-linux
ls -la ./bin
mv ./bin/kyma-linux /usr/local/bin/kyma
timeout-minutes: 10
- name: Checkout template-operator
uses: actions/checkout@v3
with:
repository: kyma-project/template-operator
path: ./template-operator/
- name: export template-operator URL
run: |
cd ./template-operator
echo "TEST_REPOSITORY_URL=$(git remote get-url origin)" >> "$GITHUB_ENV"
- name: Set up k3d
run: wget -qO - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=$K3D_VERSION bash
- name: Provision OCI Registry
run: |
k3d registry create oci.localhost --port 5001
- name: Run create module with kubebuilder-project
if: ${{ matrix.e2e-test == 'test-kubebuilder-module-creation' }}
run: |
cd ./template-operator
kyma alpha create module \
--name kyma-project.io/module/template-operator \
--path . \
--registry http://k3d-oci.localhost:5001 \
--insecure \
--kubebuilder-project \
--version $MODULE_TEMPLATE_VERSION -v \
--output /tmp/kubebuilder-template.yaml \
--sec-scanners-config sec-scanners-config.yaml
echo "MODULE_TEMPLATE_PATH=/tmp/kubebuilder-template.yaml" >> "$GITHUB_ENV"
- name: Run create module with module-config
if: ${{ matrix.e2e-test == 'test-moduleconfig-module-creation' || matrix.e2e-test == 'test-same-version-module-creation'}}
run: |
cd ./template-operator
make build-manifests
kyma alpha create module \
--name kyma-project.io/module/template-operator \
--path . \
--registry http://k3d-oci.localhost:5001 \
--insecure \
--module-config-file ./module-config.yaml \
--version $MODULE_TEMPLATE_VERSION -v \
--sec-scanners-config sec-scanners-config.yaml \
--output /tmp/module-config-template.yaml
echo "MODULE_TEMPLATE_PATH=/tmp/module-config-template.yaml" >> "$GITHUB_ENV"
- name: Create a different security scanners config file for different layers
if: ${{matrix.e2e-test == 'test-same-version-module-creation'}}
run: |
cd ./template-operator
echo \
"module-name: template-operator
rc-tag: 0.5.0
dev-branch: main
protecode:
- europe-west3-docker.pkg.dev/sap-kyma-jellyfish-dev/template-operator/component-descriptors/kyma-project.io/template-operator:v1.0.0-e2e-warning
whitesource:
language: golang-mod
exclude:
- \"**/test/**\"
- \"**/*_test.go\"" > sec-scanners-config-changed.yaml
cat sec-scanners-config-changed.yaml
- name: Verify module template
if: ${{ matrix.e2e-test == 'test-moduleconfig-module-creation' || matrix.e2e-test == 'test-kubebuilder-module-creation'}}
run: |
echo $MODULE_TEMPLATE_PATH
make -C tests/e2e test-module-creation
- name: Run E2E tests
if: ${{ matrix.e2e-test == 'test-same-version-module-creation'}}
run: |
echo $MODULE_TEMPLATE_PATH
make -C tests/e2e test-same-version-module-creation