Skip to content

Added build workflows and refactored for ruff warnings. #1

Added build workflows and refactored for ruff warnings.

Added build workflows and refactored for ruff warnings. #1

Workflow file for this run

name: Ubuntu
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
name: Python ${{ matrix.python-version }} on Ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11" ]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.ORG_PAT }} # Use the PAT for submodule authentication
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies for X11
run: |
sudo apt-get update
sudo apt-get install -y xvfb
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
- name: Create virtual environment and install dependencies
run: |
uv venv
if [ -f requirements-optional.txt ]; then uv pip install -r requirements-optional.txt; fi
uv pip install flake8 pytest pytest-cov
- name: Lint with flake8
run: |
uv run flake8 ./drone_sim_runner --count --select=E9,F63,F7,F82 --show-source --statistics
uv run flake8 ./drone_sim_runner --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests with pytest and coverage
run: |
xvfb-run -a uv run pytest --cov=drone_sim_runner --cov-report=xml