-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 2.75 KB
/
tests.yaml
File metadata and controls
95 lines (82 loc) · 2.75 KB
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
name: Test Suite
on:
- pull_request
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.8"
- 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-24.04
strategy:
matrix:
python: ['3.8', '3.10', '3.12']
steps:
- name: Check out code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install tox
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@ea90ed489690bf3b1c1fcca6ac5f9edab70aecb0 # main
with:
provider: lxd
charm-channel: 3.x/stable
charmcraft-channel: 2.x/stable
juju-channel: 3/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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-run-artifacts
path: tmp