Merge pull request #540 from OpenCOMPES/move_to_uv #1673
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
name: pytest and coverage report | |
# Triggers the workflow on push for all branches and PR only for main | |
on: | |
push: | |
branches: [ main, v1_feature_branch ] | |
paths-ignore: | |
pyproject.toml | |
pull_request: | |
branches: [ main, v1_feature_branch ] | |
env: | |
UV_SYSTEM_PYTHON: true | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
# Check out repo and set up Python | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Setup python | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Install package | |
run: | | |
uv pip install -e ".[dev]" | |
# Run pytest with coverage report, saving to xml | |
- name: Run tests on python 3.10 | |
run: | | |
pytest --cov --cov-report xml:cobertura.xml --full-trace --show-capture=no -sv -n auto tests/ | |
# Take report and upload to coveralls | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./cobertura.xml |