Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI workflow to run tests #1

Merged
merged 7 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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