Skip to content
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
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit =
58 changes: 58 additions & 0 deletions .github/workflows/test-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Scadable Tests

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main

jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -e .[dev]
- name: Run tests
run: |
pytest --cov src/scadable --cov-config=.coveragerc --cov-report lcov
# - name: Upload test coverage to coveralls.io
# uses: coverallsapp/github-action@v2
# with:
# flag-name: run-${{ matrix.os }}-${{ matrix.python-version }}
# parallel: true
- name: Ensure Code Coverage
run: coverage report --fail-under=100

# finish:
# needs: test
# if: github.event.pull_request.draft == false
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: coverallsapp/github-action@v2
# with:
# parallel-finished: true
# carryforward: "run-ubuntu-latest-3.9,run-ubuntu-latest-3.10,run-ubuntu-latest-3.11,run-ubuntu-latest-3.12,run-ubuntu-latest-3.13,run-macos-latest-3.9,run-macos-latest-3.10,run-macos-latest-3.11,run-macos-latest-3.12,run-macos-latest-3.13,run-windows-latest-3.9,run-windows-latest-3.10,run-windows-latest-3.11,run-windows-latest-3.12,run-windows-latest-3.13"
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = ["setuptools>=77.0.3"]
build-backend = "setuptools.build_meta"

[project]
name = "scadable"
version = "0.0.1"
Expand All @@ -18,6 +19,15 @@ license = "Apache-2.0"
license-files = [ "LICENSE" ]
dependencies = [
]

[project.optional-dependencies]
dev = [
"pytest",
"coverage",
"pytest-cov"
]


[project.urls]
"Homepage" = "https://github.com/scadable/library-python"
"Bug Tracker" = "https://github.com/scadable/library-python/issues"
Empty file added tests/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_module_import():
import src.scadable
Loading