Skip to content
Draft
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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: ["ci-cd"]
pull_request:
branches: ["ci-cd"]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .

- name: Run tests
run: |
pytest -v
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ version = "0.1.0"
[dependencies]
cabinetry = ">=0.6.0,<0.7"
ipykernel = ">=6.30.1,<7"
pytest = "*"

[feature.gpu.system-requirements]
cuda = "12.5"
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ exclude_lines = [
"if TYPE_CHECKING:",
]

[project.optional-dependencies]
dev = ["pytest"]

[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]
Expand Down
2 changes: 2 additions & 0 deletions src/nsbi_common_utils/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def say_hello():
print("Hello, world!")
Empty file added tests/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions tests/test_demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from nsbi_common_utils.test import say_hello

def test_say_hello_prints_message(capsys):
say_hello()

captured = capsys.readouterr()
assert captured.out == "Hello, world!\n"