This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (80 loc) · 2.35 KB
/
tests.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
name: Test Suite
on:
- pull_request
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Tox
run: pip install tox
- name: Run lint
run: tox -e lint
unit-and-func-tests:
name: Unit, & Functional Tests
runs-on: ubuntu-22.04
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox
run: pip install tox
- name: Run unit & functional tests
run: tox -e unit,functional
integration-test:
name: Integration test with LXD
runs-on: ubuntu-22.04
timeout-minutes: 40
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install tox
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.1/stable
- name: Configure LXC for Charmcraft
run: |
lxc --project charmcraft project create local:charmcraft
lxc --project charmcraft profile device add default root disk path=/ pool=default | true
lxc --project charmcraft profile device add default eth0 nic name=eth0 network=lxdbr0 | true
lxc --project charmcraft profile show default
- name: Run integration tests
run: tox -e integration
- name: Setup Debug Artifact Collection
if: ${{ failure() }}
run: mkdir tmp
- name: Collect Charmcraft Logs
if: ${{ failure() }}
run: |
mv $HOME/.local/state/charmcraft/log/* tmp/ | true
- name: Collect Juju Status
if: ${{ failure() }}
run: |
juju status 2>&1 | tee tmp/juju-status.txt
juju-crashdump -s -m controller -a debug-layer -a config -o tmp/
mv juju-crashdump-* tmp/ | true
- name: Upload debug artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: test-run-artifacts
path: tmp