Skip to content

feat(medcat): CU-869b09dk4 Update scripts download (#210) #90

feat(medcat): CU-869b09dk4 Update scripts download (#210)

feat(medcat): CU-869b09dk4 Update scripts download (#210) #90

name: medcat-den - Test
on:
push:
branches: [ main ]
pull_request:
paths:
- 'medcat-den/**'
- '.github/workflows/medcat-den**'
permissions:
id-token: write
defaults:
run:
working-directory: ./medcat-den
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12' ]
max-parallel: 4
steps:
- uses: actions/checkout@v5
- name: Install uv for Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install the project
run: |
uv sync --all-extras --dev
uv run python -m ensurepip
uv run python -m pip install --upgrade pip
- name: Check types
run: |
uv run python -m mypy --follow-imports=normal src/medcat_den
- name: Ruff linting
run: |
uv run ruff check src/medcat_den --preview
- name: Test
run: |
uv run pytest tests
publish-to-test-PyPI:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout main
uses: actions/checkout@v5
with:
fetch-depth: 0 # fetch all history
fetch-tags: true # fetch tags explicitly
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
- name: Set timestamp-based dev version
run: |
TS=$(date -u +"%Y%m%d%H%M%S")
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MEDCAT_DEN=0.2.2.dev${TS}" >> $GITHUB_ENV
- name: Install package in development mode
run: |
pip install -e .
- name: Build package
run: |
python -m build
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
packages_dir: medcat-den/dist