-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (124 loc) · 4.29 KB
/
crazylab-sanity.yml
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Crazy Stab Sanity 🗡️
# Controls when the action will run.
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
jobs:
#TODO add flashing of crazyflies
setup_mac:
runs-on: [self-hosted, macOS]
steps:
- name: Check out sources
uses: actions/checkout@v4
- name: Download latest firmware files
with:
repo: bitcraze/crazyflie-release
workflow: nightly.yml
uses: dawidd6/action-download-artifact@v4
sanity_testsuite_on_mac:
needs: [setup_mac]
runs-on: [self-hosted, macOS]
strategy:
matrix:
python_version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false
env:
TEST_FILE: Mac__sanity_test_job-${{github.run_number}}-${{ matrix.python_version }}
CRAZY_SITE: crazylab-mac
PYTHON_VERSION: ${{ matrix.python_version }}
timeout-minutes: 120
steps:
- name: Setup python environment
run: |
$(brew --prefix)/bin/python${PYTHON_VERSION} -m venv venv
source venv/bin/activate
- name: Install pytest
run: venv/bin/pip install pytest
- name: Install Crazyflie python library
run: venv/bin/pip install git+https://github.com/bitcraze/crazyflie-lib-python.git@master
- name: Install requirements
run: |
venv/bin/pip install -r requirements.txt
- name: Upgrade devices to latest firmware
run: venv/bin/python management/program.py --file cf2-nightly/firmware-cf2-nightly.zip --retries 3
- name: Run test suite
run: venv/bin/python -m pytest --verbose --html=${{env.TEST_FILE}}.html --junit-xml ${{env.TEST_FILE}}.xml -m sanity tests/QA
- name: Upload test file
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{env.TEST_FILE}}_results
if-no-files-found: warn
path: |
${{env.TEST_FILE}}.html
${{env.TEST_FILE}}.xml
assets/style.css
- name: Pretty print test results
if: ${{ !cancelled() }}
uses: pmeier/pytest-results-action@main
with:
path: ${{env.TEST_FILE}}.xml
summary: true
title: Test results
sanity_testsuite_on_linux:
if: ${{ !cancelled() }}
needs: [sanity_testsuite_on_mac]
runs-on: [self-hosted, linux]
strategy:
matrix:
python_version: ["3.10", "3.11","3.12", "3.13"]
fail-fast: false
env:
TEST_FILE: Linux_sanity_test_job-${{github.run_number}}-${{ matrix.python_version }}
CRAZY_SITE: crazylab-malmö
CRAZY_DEVICE: cf21_stock
PYTHON_VERSION: ${{ matrix.python_version }}
timeout-minutes: 120
container:
image: python:${{ matrix.python_version }}-bookworm
options: --privileged
steps:
- name: Upgrade pip
run: |
pip3 install --upgrade pip
- name: Install libusb
run: |
apt update
apt install -y libusb-1.0-0 uhubctl
- name: Install pytest
run: pip3 install pytest
- name: Install Crazyflie python library
run: pip3 install git+https://github.com/bitcraze/crazyflie-lib-python.git@master
- name: Check out sources
uses: actions/checkout@v4
- name: Install requirements
run: pip3 install -r requirements.txt
- name: Download latest firmware files
with:
repo: bitcraze/crazyflie-release
workflow: nightly.yml
uses: dawidd6/action-download-artifact@v4
- name: Reset power to all devices
run: python3 management/usb-power-reset.py -a reset
- name: Upgrade devices to latest firmware
run: python3 management/program.py --file cf2-nightly/firmware-cf2-nightly.zip --retries 3
- name: Run test suite
run: pytest --verbose --html=${{env.TEST_FILE}}.html --junit-xml ${{env.TEST_FILE}}.xml -m sanity tests/QA
- name: Upload test file
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{env.TEST_FILE}}_results
if-no-files-found: warn
path: |
${{env.TEST_FILE}}.html
${{env.TEST_FILE}}.xml
assets/style.css
- name: Pretty print test results
if: ${{ !cancelled() }}
uses: pmeier/pytest-results-action@main
with:
path: ${{env.TEST_FILE}}.xml
summary: true
title: Test results