forked from canonical/minio-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 1.97 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
# reusable workflow triggered by other actions
name: CI
on:
workflow_call:
secrets:
charmcraft-credentials:
required: true
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install tox
- name: Lint code
run: tox -vve lint
unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install tox
- name: Run unit tests
run: tox -vve unit
integration:
name: Integration Test (deploy and access)
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.21/stable
charmcraft-channel: latest/candidate
# TODO: Remove once the actions-operator does this automatically
- name: Configure kubectl
run: |
sg microk8s -c "microk8s config > ~/.kube/config"
- name: Build and test
run: |
sg microk8s -c "tox -vve integration -- --model testing"
# On failure, capture debugging resources
- name: Get all
run: kubectl get all -A
if: failure()
- name: Describe deployments
run: kubectl describe deployments -A
if: failure()
- name: Describe replicasets
run: kubectl describe replicasets -A
if: failure()
- name: Get juju status
run: juju status
if: failure()
- name: Get application logs
run: kubectl logs --tail 100 -n testing -ljuju-app=minio
if: failure()
- name: Get operator logs
run: kubectl logs --tail 100 -n testing -ljuju-operator=minio
if: failure()