diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c1b4763..a24afc4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -21,6 +21,7 @@ jobs: - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} + id: setup-python uses: actions/setup-python@v7 with: python-version: "${{ matrix.python-version }}" @@ -34,7 +35,7 @@ jobs: uses: actions/cache@v6 with: path: .venv - key: venv-${{ hashFiles('**/uv.lock') }} + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/uv.lock') }} - name: Cache prek uses: actions/cache@v6 diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml new file mode 100644 index 0000000..9bdac12 --- /dev/null +++ b/.github/workflows/pytest.yaml @@ -0,0 +1,45 @@ +name: Pytest + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + name: "Python ${{ matrix.python-version }}" + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v7 + + - name: Set up Python ${{ matrix.python-version }} + id: setup-python + uses: actions/setup-python@v7 + with: + python-version: "${{ matrix.python-version }}" + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Cache venv + uses: actions/cache@v6 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/uv.lock') }} + + - name: Install dependencies + run: uv sync --all-groups + + - name: Run pytest + run: uv run pytest -q