Skip to content

Commit 73fd503

Browse files
committed
ci: run e2e after operator ci check
Signed-off-by: drivebyer <yang.wu@daocloud.io>
1 parent 840675c commit 73fd503

File tree

2 files changed

+81
-88
lines changed

2 files changed

+81
-88
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
gotest:
2323
name: Go Test
2424
runs-on: ubuntu-latest
25+
needs:
26+
- lint
2527
steps:
2628
- uses: actions/checkout@v4
2729
- name: Set up Go
@@ -118,3 +120,82 @@ jobs:
118120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119121

120122
GOSEC_OUTPUT: "junit-xml:/github/workspace/gosec-results.xml"
123+
124+
validate-yaml:
125+
name: Validate YAML
126+
runs-on: ubuntu-latest
127+
needs:
128+
- gotest
129+
steps:
130+
- name: Checkout code
131+
uses: actions/checkout@v4
132+
- name: Install yamllint
133+
run: sudo apt-get install -y yamllint
134+
- name: Lint YAML files
135+
run: yamllint --strict ./tests/
136+
137+
e2e-test:
138+
needs: [validate-yaml]
139+
name: ${{ matrix.testpath }}
140+
runs-on: ubuntu-latest
141+
strategy:
142+
matrix:
143+
testpath:
144+
- ./tests/e2e-chainsaw/v1beta2/teardown/
145+
- ./tests/e2e-chainsaw/v1beta2/setup/
146+
- ./tests/e2e-chainsaw/v1beta2/hostnetwork/
147+
- ./tests/e2e-chainsaw/v1beta2/password/
148+
- ./tests/e2e-chainsaw/v1beta2/ha-setup/
149+
- ./tests/e2e-chainsaw/v1beta2/ha-failover/
150+
- ./tests/e2e-chainsaw/v1beta2/nodeport/
151+
- ./tests/e2e-chainsaw/v1beta2/pvc-name/
152+
- ./tests/e2e-chainsaw/v1beta2/keep-pvc/
153+
- ./tests/e2e-chainsaw/v1beta2/acl-user/
154+
- ./tests/e2e-chainsaw/v1beta2/scaling/
155+
- ./tests/e2e-chainsaw/v1beta2/ignore-annots/
156+
157+
steps:
158+
- name: Checkout code
159+
uses: actions/checkout@v4
160+
161+
- name: Build Dockerfile
162+
run: docker build . --file Dockerfile --tag redis-operator:e2e
163+
164+
- name: Install chainsaw
165+
uses: kyverno/chainsaw/.github/actions/install@v0.0.9
166+
with:
167+
release: v0.1.7
168+
169+
- name: Check install
170+
run: chainsaw version
171+
172+
- name: Install kubectl
173+
run: |
174+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
175+
chmod +x kubectl
176+
sudo mv kubectl /usr/local/bin/
177+
178+
# - name: Install Redis
179+
# uses: shogo82148/actions-setup-redis@v1
180+
181+
- name: Create k8s Kind Cluster
182+
uses: helm/kind-action@v1.10.0
183+
with:
184+
config: tests/_config/kind-config.yaml
185+
cluster_name: kind
186+
187+
- name: Load Docker image into Kind
188+
run: |
189+
kubectl cluster-info --context kind-kind
190+
kind load docker-image redis-operator:e2e --name kind
191+
192+
- name: Install Redis Operator
193+
run: |
194+
make deploy IMG=redis-operator:e2e
195+
196+
- name: Wait for Redis Operator to be ready
197+
run: |
198+
kubectl wait --for=condition=available --timeout=300s deployment/redis-operator-redis-operator -n redis-operator-system
199+
200+
- name: Run chainsaw test
201+
run: chainsaw test --test-dir ${{ matrix.testpath }} --config tests/_config/chainsaw-configuration.yaml

.github/workflows/e2e-chainsaw.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)