Upgrade package to uv #111
Workflow file for this run
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: Build and Test | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**/_version.py' | |
| push: | |
| branches: [ main ] | |
| tags-ignore: | |
| - 'v*' | |
| paths-ignore: | |
| - '**/_version.py' | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| uv-resolution: ["highest", "lowest"] | |
| exclude: | |
| - python-version: "3.11" | |
| uv-resolution: "lowest" | |
| - python-version: "3.12" | |
| uv-resolution: "lowest" | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| id: setup-uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ github.event.inputs.python-version }} | |
| - name: Set up AllenInstitute Repo Authorization | |
| uses: ./.github/actions/configure-org-repo-authorization | |
| with: | |
| token: ${{ secrets.AI_PACKAGES_TOKEN }} | |
| ssh_private_key: ${{ secrets.AIBSGITHUB_PRIVATE_KEY }} | |
| - name: Run Release | |
| run: | | |
| if [ ${{ matrix.uv-resolution }} == "highest" ]; then | |
| make release | |
| else | |
| # Install dependencies | |
| uv sync --frozen --group dev --resolution ${{ matrix.uv-resolution }} | |
| # Linting | |
| uv run ruff check | |
| uv run mypy ./ | |
| # Testing | |
| uv run pytest -vv --durations=10 | |
| fi | |
| shell: bash | |
| - name: Upload coverage reports | |
| if: | | |
| ${{ | |
| success() | |
| && ( | |
| (github.event_name == 'pull_request' && github.base_ref == 'main') | |
| || (github.event_name == 'push' && github.ref_name == 'main') | |
| || github.event_name == 'workflow_dispatch' | |
| ) | |
| && matrix.python-version == '3.12' | |
| }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| # https://github.com/codecov/codecov-action#arguments | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| env_vars: PYTHON_VERSION |