mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 13:52:43 +08:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com> Co-authored-by: Robert Brennan <accounts@rbren.io>
52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
# Workflow that runs python unit tests
|
|
name: Run Python Unit Tests
|
|
|
|
# The jobs in this workflow are required, so they must run at all times
|
|
# * Always run on "main"
|
|
# * Always run on PRs
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# Run python unit tests on Linux
|
|
test-on-linux:
|
|
name: Python Unit Tests on Linux
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
INSTALL_DOCKER: '0' # Set to '0' to skip Docker installation
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.12']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Install tmux
|
|
run: sudo apt-get update && sudo apt-get install -y tmux
|
|
- name: Install poetry via pipx
|
|
run: pipx install poetry
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'poetry'
|
|
- name: Install Python dependencies using Poetry
|
|
run: poetry install --without evaluation,llama-index
|
|
- name: Build Environment
|
|
run: make build
|
|
- name: Run Tests
|
|
run: poetry run pytest --forked -n auto --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|