Skip to content

Use metadata version for __version__ #6

Use metadata version for __version__

Use metadata version for __version__ #6

Workflow file for this run

name: pull_request
on:
pull_request:
paths:
- 'pyensemblrest/**.py'
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
environment: dev
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set Poetry Version
id: set-poetry-version
run: echo "POETRY_VERSION=$(cat .poetry-version)" >> $GITHUB_OUTPUT
- name: Install Poetry
id: install-poetry-version
uses: snok/install-poetry@v1
with:
version: ${{ steps.set-poetry-version.outputs.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run pre-commit hooks, excluding unit tests
run: SKIP=unit-test poetry run pre-commit run --all-files
- name: Run unit tests with pytest and code coverage with pytest-cov
run: poetry run pytest -v --cov=pyensemblrest --cov-report lcov:./tests/lcov.info
- name: Upload Coverage Results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./tests/lcov.info