-
Notifications
You must be signed in to change notification settings - Fork 13
87 lines (82 loc) · 2.36 KB
/
ci.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
name: 'Build & Test'
on:
- push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
prerelease: true
- name: Ensure lock file is up to date
run: |
pdm lock --check
- name: Install dependencies
run: |
pdm sync -d
- name: Run Lint
run: |
pdm run lint
- name: Run Tests
run: |
pdm run pytest
ci:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Kustomize Build'
uses: karancode/kustomize-github-action@master
with:
kustomize_version: '5.3.0'
kustomize_build_dir: './manifests/overlays/generic-rbac'
kustomize_output_file: "operator.yaml"
enable_alpha_plugins: false
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
kubectl_version: "v1.28.6"
- name: 'Check K8s server is up&running'
run: |
sleep 10
kubectl get nodes
kubectl get pods -A
- name: 'Install the operator'
run: |
kubectl apply -f operator.yaml
- name: 'List namespaces'
run: |
kubectl get ns
- name: 'Check operator pod is running'
run: |
sleep 60
kubectl -n chaostoolkit-crd get deploy
kubectl -n chaostoolkit-crd get pods
- name: 'Create the example experiment'
run: |
kubectl apply -f examples/basic.yaml
- name: 'Check the chaostoolkit experiment'
run: |
kubectl -n chaostoolkit-crd get ctk
- name: 'Wait for experiment pod to run (docker pull & run experiment)'
run: |
sleep 120
kubectl -n chaostoolkit-run get pods
- name: 'Check operator logs'
run: |
kubectl -n chaostoolkit-crd logs -l app=chaostoolkit-crd
- name: 'Check chaostoolkit pod logs'
run: |
kubectl -n chaostoolkit-run logs -l app=chaostoolkit
- name: 'Assert experiment succeeded'
run: |
kubectl -n chaostoolkit-run get pods | grep chaos | grep Completed