Skip to content

Commit

Permalink
Add CI workflow to run tests (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z authored Aug 18, 2024
1 parent 3df3884 commit 85ddea5
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ubuntu-latest, macOS-latest, windows-latest]
fail-fast: false # Continue running jobs even if one fails

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.17

- name: Set up PDM
uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4.1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pdm sync --dev --group testing
- name: Run Tests
run: |
pdm run --verbose pytest tests
74 changes: 69 additions & 5 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"prometheus-fastapi-instrumentator>=7.0.0,<8",
"sentry-sdk[fastapi]>=2.13.0,<3",
"typer>=0.12.4,<1",
"prometheus-fastapi-instrumentator>=7.0.0",
"sentry-sdk[fastapi]>=2.13.0",
"typer>=0.12.4",
]

dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/watonomous/watcloud-utils"

[project.optional-dependencies]
testing = [
"pytest>=8.3.2",
]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
Expand Down
4 changes: 4 additions & 0 deletions tests/test_sanity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import watcloud_utils

def test_version():
assert hasattr(watcloud_utils, "__version__") and watcloud_utils.__version__ is not None

0 comments on commit 85ddea5

Please sign in to comment.