Skip to content

Commit

Permalink
Add flashing of devices from sanity job.
Browse files Browse the repository at this point in the history
On mac flashing fails on python version 3.8, a version that will soon not be supportd so it is removed from sanity for now.
  • Loading branch information
ToveRumar committed Aug 14, 2024
1 parent f126037 commit 939c3bd
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/crazylab-linux-experiment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
with:
if-no-files-found: warn
name: test_report_${{github.run_number}}
path: |
path: |
${{env.TEST_FILE}}.html
${{env.TEST_FILE}}.xml
assets/style.css
Expand All @@ -90,3 +90,5 @@ jobs:
path: ${{env.TEST_FILE}}.xml
summary: true
title: Test results


58 changes: 41 additions & 17 deletions .github/workflows/crazylab-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ on:
- cron: '0 6 * * *'
jobs:
#TODO add flashing of crazyflies
checkout_sources_mac:
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: checkout_sources_mac
needs: [setup_mac]
runs-on: [self-hosted, macOS]
strategy:
matrix:
python_version: ["3.8","3.9", "3.10", "3.11"]
python_version: ["3.9", "3.10", "3.11"]
fail-fast: false
env:
TEST_FILE: Mac__sanity_test_job-${{github.run_number}}-${{ matrix.python_version }}
Expand All @@ -38,8 +43,12 @@ jobs:
run: venv/bin/pip install git+https://github.com/bitcraze/crazyflie-lib-python.git@master

- name: Install requirements
run: |
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

- 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

Expand All @@ -49,22 +58,22 @@ jobs:
with:
name: ${{env.TEST_FILE}}_results
if-no-files-found: warn
path: |
path: |
${{env.TEST_FILE}}.html
${{env.TEST_FILE}}.xml
${{env.TEST_FILE}}.xml
assets/style.css
- name: Pretty print test results
if: always()
uses: pmeier/pytest-results-action@main
with:
path: ${{env.TEST_FILE}}.xml
path: ${{env.TEST_FILE}}.xml
summary: true
title: Test results

sanity_testsuite_on_linux:
if: always()
needs: sanity_testsuite_on_mac #They should not run simultaneously. But one after the other
needs: [sanity_testsuite_on_mac]
runs-on: [self-hosted, linux]
strategy:
matrix:
Expand All @@ -84,6 +93,11 @@ jobs:
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

Expand All @@ -96,26 +110,36 @@ jobs:
- 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 -m sanity tests/QA

- name: Upload test file
if: always()
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
path: |
${{env.TEST_FILE}}.html
${{env.TEST_FILE}}.xml
assets/style.css
- name: Pretty print test results
if: always()
uses: pmeier/pytest-results-action@main
with:
path: ${{env.TEST_FILE}}.xml
path: ${{env.TEST_FILE}}.xml
summary: true
title: Test results


title: Test results

0 comments on commit 939c3bd

Please sign in to comment.