Skip to content

Commit 89bfe80

Browse files
authored
Merge pull request #8 from scadable/4/test-pipeline
Test Pipeline
2 parents c93a100 + 58d9e8b commit 89bfe80

File tree

5 files changed

+72
-0
lines changed

5 files changed

+72
-0
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit =

.github/workflows/test-project.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Scadable Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
test:
12+
if: github.event.pull_request.draft == false
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
fail-fast: false
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Cache pip
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
${{ runner.os }}-
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip setuptools
37+
pip install -e .[dev]
38+
- name: Run tests
39+
run: |
40+
pytest --cov src/scadable --cov-config=.coveragerc --cov-report lcov
41+
# - name: Upload test coverage to coveralls.io
42+
# uses: coverallsapp/github-action@v2
43+
# with:
44+
# flag-name: run-${{ matrix.os }}-${{ matrix.python-version }}
45+
# parallel: true
46+
- name: Ensure Code Coverage
47+
run: coverage report --fail-under=100
48+
49+
# finish:
50+
# needs: test
51+
# if: github.event.pull_request.draft == false
52+
# runs-on: ubuntu-latest
53+
# steps:
54+
# - name: Coveralls Finished
55+
# uses: coverallsapp/github-action@v2
56+
# with:
57+
# parallel-finished: true
58+
# 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"

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
requires = ["setuptools>=77.0.3"]
33
build-backend = "setuptools.build_meta"
4+
45
[project]
56
name = "scadable"
67
version = "0.0.1"
@@ -18,6 +19,15 @@ license = "Apache-2.0"
1819
license-files = [ "LICENSE" ]
1920
dependencies = [
2021
]
22+
23+
[project.optional-dependencies]
24+
dev = [
25+
"pytest",
26+
"coverage",
27+
"pytest-cov"
28+
]
29+
30+
2131
[project.urls]
2232
"Homepage" = "https://github.com/scadable/library-python"
2333
"Bug Tracker" = "https://github.com/scadable/library-python/issues"

tests/__init__.py

Whitespace-only changes.

tests/test_import.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_module_import():
2+
import src.scadable

0 commit comments

Comments
 (0)