Skip to content

Commit

Permalink
Add GitHub Actions CI to run pytest (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Nov 8, 2023
1 parent edaaa41 commit ca324d8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Test"
on:
pull_request:
push:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install hatch
run: pipx install hatch
- name: Run tests
run: hatch run test:run
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ all = [
"typing",
]

[tool.hatch.envs.test]
dependencies = [
"pytest>=7.2.2",
"pytest-timeout>=2.1.0",
]

[tool.hatch.envs.test.scripts]
run = "pytest"

[tool.black]
target-version = ["py37"]
line-length = 120
Expand Down

0 comments on commit ca324d8

Please sign in to comment.