diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..1811d3c --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,68 @@ +# CI for the Python sample in python/. One workflow per sample implementation: +# add a sibling workflow (e.g. dotnet.yml) when another language sample lands. +name: Python sample + +on: + push: + branches: [main] + paths: + - 'python/**' + - '.github/workflows/python.yml' + pull_request: + paths: + - 'python/**' + - '.github/workflows/python.yml' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: python-sample-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +defaults: + run: + working-directory: python + +jobs: + lint: + name: ruff + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: '3.12' + cache: pip + cache-dependency-path: python/pyproject.toml + + - name: Install + run: pip install -e ".[dev]" + + - name: Lint + run: ruff check src tests + + test: + name: pytest (${{ matrix.python-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # pyproject sets requires-python >= 3.11. + python-version: ['3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: python/pyproject.toml + + - name: Install + run: pip install -e ".[dev]" + + - name: Test + run: pytest -v diff --git a/python/README.md b/python/README.md index ea0c801..2d4bfaa 100644 --- a/python/README.md +++ b/python/README.md @@ -1,5 +1,7 @@ # rowing-data (Python) +[![Python sample](https://github.com/MoveLab-Studio/rowing-data-standard/actions/workflows/python.yml/badge.svg)](https://github.com/MoveLab-Studio/rowing-data-standard/actions/workflows/python.yml) + A **draft** Python implementation of the [Rowing Data Standard](../spec/FIT_STANDARD.md). This package implements **Draft v0.1**, which is not ratified. Field IDs, scales @@ -59,3 +61,9 @@ cd python pytest ruff check src tests ``` + +CI runs exactly these two commands on Python 3.11, 3.12 and 3.13 +([`.github/workflows/python.yml`](../.github/workflows/python.yml)), and only +when something under `python/` changes. The interop test against the +`rowingdata` golden FIT file skips on CI, since that file is not in this +repository.