Skip to content

Commit

Permalink
Add linux sanity run
Browse files Browse the repository at this point in the history
  • Loading branch information
ToveRumar committed Aug 12, 2024
1 parent df5ac1e commit 66bbec6
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 65 deletions.
65 changes: 0 additions & 65 deletions .github/workflows/crazylab-mac.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/crazylab-sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Crazy Stab Lab Mac 🗡️

# Controls when the action will run.
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
jobs:
#TODO add flashing of crazyflies
checkout_sources_mac:
runs-on: [self-hosted, macOS]
steps:
- name: Check out sources
uses: actions/checkout@v4

sanity_testsuite_on_mac:
needs: checkout_sources_mac
runs-on: [self-hosted, macOS]
strategy:
matrix:
python_version: ["3.8","3.9", "3.10", "3.11"]
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: 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: 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
assets/style.css
- name: Pretty print test results
if: always()
uses: pmeier/pytest-results-action@main
with:
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
runs-on: [self-hosted, linux]
strategy:
matrix:
python_version: ["3.8","3.9", "3.10", "3.11"]
fail-fast: false
env:
TEST_FILE: Linux_sanity_test_job-${{github.run_number}}-${{ matrix.python_version }}
CRAZY_SITE: crazylab-mac
PYTHON_VERSION: ${{ matrix.python_version }}
timeout-minutes: 120
container:
image: python:${{ matrix.python_version }}-buster
options: --privileged
steps:
- 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: 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
assets/style.css
- name: Pretty print test results
if: always()
uses: pmeier/pytest-results-action@main
with:
path: ${{env.TEST_FILE}}.xml
summary: true
title: Test results


0 comments on commit 66bbec6

Please sign in to comment.