-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WSL workflow for Python unit tests
- Loading branch information
1 parent
377fadc
commit d7fbb29
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Run Python Unit Tests on WSL | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-on-wsl: | ||
name: Python Unit Tests on WSL | ||
runs-on: windows-latest | ||
env: | ||
INSTALL_DOCKER: '0' | ||
strategy: | ||
matrix: | ||
python-version: ['3.12'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup WSL | ||
uses: Vampire/setup-wsl@v3 | ||
with: | ||
distribution: Ubuntu-22.04 | ||
update: true | ||
- name: Install poetry via pipx in WSL | ||
shell: wsl-bash {0} | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Set up Python in WSL | ||
shell: wsl-bash {0} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python${{ matrix.python-version }} | ||
- name: Install Python dependencies using Poetry | ||
shell: wsl-bash {0} | ||
run: | | ||
poetry install --without evaluation,llama-index | ||
- name: Build Environment | ||
shell: wsl-bash {0} | ||
run: make build | ||
- name: Run Tests | ||
shell: wsl-bash {0} | ||
run: poetry run pytest --forked --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |