mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: Test & Lint Python
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
|
|
jobs:
|
|
ruff:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Run ruff check
|
|
run: uvx ruff check src/
|
|
|
|
pytest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
python-version: ["3.11", "3.12", "3.13"]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --extra test
|
|
|
|
# On windows-latest, bash tests auto-skip unless Git-for-Windows
|
|
# bash (MSYS2/MINGW) is detected. The WSL launcher is rejected
|
|
# because it cannot handle native Windows paths in test fixtures.
|
|
# See tests/conftest.py::_has_working_bash() for details.
|
|
- name: Run tests
|
|
run: uv run pytest
|