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: Static Analysis, Unit Tests, and Documentation | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "!**" | |
| workflow_call: | |
| env: | |
| UV_VERSION: 0.8.22 | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| Tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1 | |
| with: | |
| version: "${{ env.UV_VERSION }}" | |
| python-version: "${{ matrix.PYTHON_VERSION }}" | |
| enable-cache: 'true' | |
| cache-suffix: "${{ matrix.PYTHON_VERSION }}" | |
| - name: Install dependencies | |
| run: | | |
| uv sync --locked --extra pysam | |
| - name: Test the library | |
| run: | | |
| uv run poe check-all | |
| - name: Run docs | |
| run: | | |
| set -euo pipefail | |
| uv run poe build-docs | |
| - name: Upload code coverage | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| Tests-without-pysam: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1 | |
| with: | |
| version: "${{ env.UV_VERSION }}" | |
| python-version: "3.11" | |
| enable-cache: 'true' | |
| cache-suffix: "3.11-no-pysam" | |
| - name: Install dependencies (without pysam) | |
| run: | | |
| uv sync --locked | |
| - name: Verify pysam is not installed | |
| run: | | |
| ! uv run python -c "import pysam" 2>/dev/null | |
| - name: Test core modules (without pysam) | |
| run: | | |
| uv run pytest tests/fgpyo/test_sequence.py tests/fgpyo/test_read_structure.py tests/fgpyo/collections/ tests/fgpyo/io/ tests/fgpyo/util/test_inspect.py tests/fgpyo/util/test_metric.py tests/fgpyo/util/test_string.py tests/fgpyo/util/test_types.py -v |