Crazy Stab Lab 🗡️ #188
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Crazy Stab Lab 🗡️ | |
# Controls when the action will run. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
testsuite_at_crazylab: | |
runs-on: [self-hosted, linux] | |
timeout-minutes: 120 | |
container: | |
image: python:3.13.0-bookworm | |
options: --privileged | |
env: | |
CRAZY_SITE: crazylab-malmö | |
TEST_FILE: TestRun-${{github.run_number}} | |
steps: | |
- name: Install libusb | |
run: | | |
apt update | |
apt install -y libusb-1.0-0 uhubctl | |
- name: Upgrade pip | |
run: | | |
pip3 install --upgrade pip | |
- 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 | |
- name: Run test suite | |
run: pytest --verbose --html=${{env.TEST_FILE}}.html --junit-xml ${{env.TEST_FILE}}.xml tests/QA | |
- name: Checkout Crazyflie python library | |
uses: actions/checkout@v4 | |
with: | |
repository: bitcraze/crazyflie-lib-python | |
path: crazyflie-lib-python | |
- name: Pip install the library | |
run: pip3 install crazyflie-lib-python/ | |
- name: Run Crazyflie python library examples | |
run: | | |
python3 -u utils/run_examples.py --path crazyflie-lib-python | |
- name: Upload test file | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: warn | |
name: test_report_${{github.run_number}} | |
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 | |