Skip to content

Commit

Permalink
ci: Test on PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 13, 2023
1 parent 5d698cd commit 6e3a843
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Publish to PyPI
name: Build

on:
release:
types: [published]
push:

permissions:
contents: write
Expand All @@ -13,31 +12,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
env:
PIP_CONSTRAINT: .github/workflows/constraints.txt
run: |
pipx install hatch
- name: Build
run: |
hatch build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- uses: hynek/build-and-inspect-python-package@v1

upload:
publish:
runs-on: ubuntu-latest
needs: build
environment: publish
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: dist
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
- src/**
- tests/**
- pyproject.toml
- .github/workflows/test.yml
- .github/workflows/test.yaml
- .github/workflows/constraints.txt
pull_request:
branches: [ main ]
paths:
- src/**
- tests/**
- pyproject.toml
- .github/workflows/test.yml
- .github/workflows/test.yaml
- .github/workflows/constraints.txt
workflow_dispatch: {}
schedule:
Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.12"
Expand All @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.12"
Expand All @@ -75,14 +75,17 @@ jobs:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- python-version: "pypy3.10"
os: "ubuntu-latest"

- python-version: "3.12"
os: "windows-latest"

- python-version: "3.12"
os: "macos-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python-version }}
Expand All @@ -94,9 +97,9 @@ jobs:
pipx install hatch
- name: Run tests
env:
HATCH_ENV: "test.py${{ matrix.python-version }}"
HATCH_ENV: "test"
run: |
hatch run cov
hatch run +py=${{ matrix.python-version }} cov
- uses: actions/upload-artifact@v3
with:
name: coverage-data
Expand All @@ -111,7 +114,7 @@ jobs:
HATCH_ENV: coverage
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test = "pytest {args:tests}"
cov = "coverage run -m pytest {args:tests}"

[[tool.hatch.envs.test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.10"]

[tool.hatch.envs.coverage]
dependencies = [
Expand Down

0 comments on commit 6e3a843

Please sign in to comment.