Skip to content

Add pytest GitHub Action workflow - #14

Merged
hzhangxyz merged 2 commits into
mainfrom
copilot/add-github-action-pytest
Dec 22, 2025
Merged

Add pytest GitHub Action workflow#14
hzhangxyz merged 2 commits into
mainfrom
copilot/add-github-action-pytest

Conversation

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

Adds automated pytest execution via GitHub Actions on push and pull requests.

Implementation

  • Workflow file: .github/workflows/pytest.yml
  • Python versions: 3.11, 3.12, 3.13, 3.14 (matrix strategy with fail-fast: false)
  • Package manager: uv via astral-sh/setup-uv@v7 with caching enabled
  • Dependencies: Installs via uv sync --locked --extra dev
  • Test execution: uv run pytest

Key differences from reference implementation

  • No working-directory parameter (root-level project vs. subdirectory structure)
  • Python version range aligned with pyproject.toml requirement (>=3.11)
Original prompt

This section details on the original issue you should resolve

<issue_title>写一个GitHub action来做pytest</issue_title>
<issue_description>参考另一个项目的做法:

name: egg-pytest
permissions:
contents: read

on:

  • pull_request
  • push

env:
PYTHON_LATEST_VERSION: '3.14'

jobs:
pytest:
runs-on: ubuntu-latest

strategy:
  fail-fast: false
  matrix:
    python-version: ['3.11', '3.12', '3.13', '3.14']

steps:
  - uses: actions/checkout@v6

  - uses: astral-sh/setup-uv@v7
    with:
      python-version: ${{ matrix.python-version }}
      enable-cache: true

  - name: dependencies
    working-directory: egg
    run: uv sync --locked --extra dev

  - name: pytest
    working-directory: egg
    run: uv run pytest</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 22, 2025
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub action to run pytest Add pytest GitHub Action workflow Dec 22, 2025
Copilot AI requested a review from hzhangxyz December 22, 2025 16:01
@hzhangxyz
hzhangxyz marked this pull request as ready for review December 22, 2025 16:06
Copilot AI review requested due to automatic review settings December 22, 2025 16:06
@hzhangxyz
hzhangxyz merged commit 1280193 into main Dec 22, 2025
21 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automated pytest execution via GitHub Actions to run tests on every push and pull request. The workflow uses uv for fast dependency management and tests across multiple Python versions using a matrix strategy.

Key changes:

  • Added pytest workflow with Python version matrix (3.11, 3.12, 3.13, 3.14)
  • Configured uv for dependency installation with caching enabled
  • Set up automated test execution with fail-fast: false to test all Python versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +10
env:
PYTHON_LATEST_VERSION: '3.14'

Copilot AI Dec 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PYTHON_LATEST_VERSION environment variable is defined but never used anywhere in the workflow. Consider removing this unused variable or utilizing it if it was intended for a specific purpose.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

写一个GitHub action来做pytest

3 participants