Skip to content

Merge pull request #576 from Knowledge-Graph-Hub/chore/metatraits-gtd… #1375

Merge pull request #576 from Knowledge-Graph-Hub/chore/metatraits-gtd…

Merge pull request #576 from Knowledge-Graph-Hub/chore/metatraits-gtd… #1375

Workflow file for this run

name: kg-microbe QC
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12" ]
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0 # Fetch all history for accurate versioning
- name: Install Poetry
run: |
pipx install poetry
pipx inject poetry poetry-dynamic-versioning
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install --no-interaction --all-extras --no-root
- name: Run CodeSpell
run: poetry run tox -e codespell
- name: Linting
run: poetry run tox -e lint
- name: Validate canonical mapping schemas
# Schema validator gate for mappings/canonical/*.tsv. Catches
# malformed CURIEs, prefix/source mismatches, off-domain target
# ontologies, and lexical drift. Runs only on Python 3.10 to
# avoid duplicating across the matrix (validator is stdlib-only).
if: matrix.python-version == '3.10'
run: |
for f in mappings/canonical/*.tsv; do
echo "=== $(basename "$f") ==="
poetry run python mappings/validate_mapping_schema.py --profile canonical --path "$f" || exit 1
done
- name: Detect cross-file label collisions in canonical mappings
# Fail the build if the same subject_label maps to different object_ids
# across the canonical mapping files. Currently 0; this gate keeps it
# at 0 by surfacing accidental drift the moment it lands in a PR.
if: matrix.python-version == '3.10'
run: poetry run python mappings/validate_mapping_schema.py --cross-file-conflicts
- name: Test with pytest and generate coverage file
run: poetry run tox -e py