-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (101 loc) · 3.35 KB
/
integrate.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
120
121
122
123
124
# reusable workflow triggered by other actions
name: CI
on:
workflow_call:
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
jobs:
lib-check:
name: Check libraries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/check-libraries@2.3.0
with:
credentials: "${{ secrets.CHARMCRAFT_CREDENTIALS }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
lint:
name: Lint Check
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get install python3-pip tox
- name: Lint code
run: tox -e lint
unit:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get install python3-pip tox
- name: Run unit tests
run: tox -e unit
integration:
name: Integration tests (microk8s)
runs-on: ubuntu-22.04
steps:
- name: Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v1.8.7
with:
comment_on_pr: "false"
- name: Maximise GH runner space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 29696
remove-dotnet: "true"
remove-haskell: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"
- uses: actions/checkout@v3
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@1.1.0
with:
juju-channel: 3.1/stable
lxd-channel: 5.20/stable
provider: microk8s
channel: 1.28-strict/stable
microk8s-addons: "dns storage rbac metallb:10.64.140.43-10.64.140.49"
- name: Run integration tests
run: sg snap_microk8s -c "tox -vve integration -- --model testing"
# On failure, capture debugging resources
- name: Get all
run: kubectl get all -A
- name: Get juju status
run: juju status
- name: Get juju debug logs
run: juju debug-log --limit 100
if: failure()
- name: Get workload logs
run: kubectl logs --tail 100 -ntesting -lapp.kubernetes.io/name=zenml-server
if: failure()
- name: Get operator logs
run: kubectl logs --tail 100 -ntesting -loperator.juju.is/name=zenml-server
if: failure()
- name: Get container logs
run: kubectl logs --tail 100 -ntesting -lapp.kubernetes.io/name=zenml-server -czenml-server
if: failure()
- name: Describe zenml pod
run: kubectl describe po -ntesting -lapp.kubernetes.io/name=zenml-server
if: failure()
- name: Get jobs
run: kubectl get jobs -ntesting
if: failure()
- name: Get mysql workload logs
run: kubectl logs --tail 100 -ntesting -lapp.kubernetes.io/name=mysql-k8s
if: failure()
- name: Describe mysql pod
run: kubectl describe po -ntesting -lapp.kubernetes.io/name=mysql-k8s
if: failure()
- name: Get mysql container logs
run: kubectl logs --tail 100 -ntesting -lapp.kubernetes.io/name=mysql-k8s -cmysql
if: failure()