Tests for pueblo.nlp #422
This file contains hidden or 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: Tests for pueblo.nlp | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/nlp.yml' | |
| - 'pueblo/nlp/**' | |
| - 'tests/nlp/**' | |
| - 'tests/*nlp*' | |
| - 'pyproject.toml' | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '.github/workflows/nlp.yml' | |
| - 'pueblo/nlp/**' | |
| - 'tests/nlp/**' | |
| - 'tests/*nlp*' | |
| - 'pyproject.toml' | |
| # Allow job to be triggered manually. | |
| workflow_dispatch: | |
| # Run job each night. | |
| schedule: | |
| - cron: '0 3 * * *' | |
| # Cancel in-progress jobs when pushing to the same branch. | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - "ubuntu-latest" | |
| python-version: | |
| - "3.8" | |
| - "3.13" | |
| name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }} | |
| steps: | |
| - name: Acquire sources | |
| uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v10.0.1 | |
| with: | |
| activate-environment: 'true' | |
| cache-suffix: ${{ matrix.python-version }} | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install project | |
| run: | | |
| uv pip install --upgrade --editable='.[nlp,develop,test]' | |
| - name: Install spaCy models | |
| run: | | |
| uv pip install pip | |
| python -m spacy download en_core_web_sm | |
| - name: Run linter and software tests | |
| run: | | |
| pytest -m nlp | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| fail_ci_if_error: true |