Switch from poetry to uv #1156
This file contains 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: CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.event_name }}-${{ github.ref }} | |
jobs: | |
test: | |
name: Run tests & display coverage | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
env: | |
# Configure a constant location for the uv cache | |
UV_CACHE_DIR: /tmp/.uv-cache | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Restore uv cache | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.uv-cache | |
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
restore-keys: | | |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
uv-${{ runner.os }} | |
- name: Run tests | |
run: pipx run uv run pytest | |
env: | |
COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_1: ${{ secrets.COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_1 }} | |
COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_2: ${{ secrets.COVERAGE_COMMENT_E2E_GITHUB_TOKEN_USER_2 }} | |
COVERAGE_COMMENT_E2E_ACTION_REF: ${{ github.sha }} | |
COVERAGE_COMMENT_E2E_REPO_SUFFIX: ${{ github.event.number }} | |
- name: Coverage comment | |
id: coverage_comment | |
uses: py-cov-action/python-coverage-comment-action@main | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
ANNOTATE_MISSING_LINES: true | |
- name: Store Pull Request comment to be posted | |
uses: actions/upload-artifact@v4 | |
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | |
with: | |
name: python-coverage-comment-action | |
path: python-coverage-comment-action.txt | |
- name: Minimize uv cache | |
run: uv cache prune --ci |