Skip to content

Commit

Permalink
Merge pull request #12 from AFM-SPM/ns-rse/7-ci-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-rse authored Nov 17, 2023
2 parents 3be2f3d + 87acf61 commit 178c324
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests (pytest)

on:
pull_request:
branches:
- main

jobs:
build:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and install test dependencies
run: |
pip install --upgrade pip
pip install -e .[dev]
- name: Test with pytest
run: |
pytest --cov=topofileformats -x
- name: Determine coverage
run: |
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,8 @@ dmypy.json
.pyre/

# VSCode
.vscode/
.vscode/

# Emacs
*~
\#*
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ keywords = [
"afm",
"image processing"
]
dependencies = ["numpy"]
dependencies = [
"matplotlib",
"numpy"
]

[project.optional-dependencies]
dev = [
Expand All @@ -39,7 +42,7 @@ dev = [

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--cov --mpl"
addopts = "--cov"
testpaths = [
"tests",
]
Expand Down

0 comments on commit 178c324

Please sign in to comment.