Skip to content

Commit

Permalink
Add testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfpereira committed Feb 5, 2025
1 parent ef9b17d commit 8d311a5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Testing"

on:
push:
branches: [main, github-actions-test]
paths-ignore:
- "docs/**"
- "README.rst"
- "LICENSE.md"
- ".github/workflows/docs.yml"
- ".gitignore"

pull_request:
branches: [main]
paths-ignore:
- "docs/**"
- "README.rst"
- ".github/workflows/docs.yml"
- "LICENSE.md"
- ".gitignore"

jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.11]
fail-fast: false
env:
JUPYTER_PLATFORM_DIRS: 1

steps:
- uses: actions/checkout@v4
- name: Build using Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}

- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{matrix.os}}-${{matrix.python-version}}-${{ hashFiles('pyproject.toml') }}

- name: install dependencies [pip]
run: |
pip install --upgrade pip setuptools wheel
pip install -e .[dev,all]
- name: unit testing for polpo [pytest]
run: |
pytest --cov-report term -m "not local" --cov=polpo ${{matrix.test-folder}}
- name: uploading code coverage [codecov]
if: ${{ matrix.test-folder == 'tests/tests_geomstats/' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.geomstats-backend }}
fail_ci_if_error: false
4 changes: 3 additions & 1 deletion notebooks/how_to/load_server_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"markers": ["local"]

},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ doc = [
"sphinx_gallery",
"pydata-sphinx-theme",
]
lint = ["ruff"]
test = ["pytest", "pytest-cov", "coverage", "jupyter", "ipython"]
dash = ["dash", "dash-bootstrap-components"]
plot = ["plotly"]
mri = ["nibabel", "scikit-image"]
Expand All @@ -48,6 +50,7 @@ dataframe = ["pandas"]
ssh = ["paramiko", "scp"]
preprocessing = ["polpo[mri,mesh,dataframe,ssh,point_cloud]"]
hydra = ["hydra-core", "omegaconf"]
dev = ["polpo[doc,lint,test]"]
all = ["polpo[dash,plot,preprocessing,hydra]"]

[project.urls]
Expand All @@ -74,4 +77,4 @@ convention = "numpy"
"tests/*" = ["D"]

[tool.pytest.ini_options]
markers = ["slow: for slow tests."]
markers = ["slow: for slow tests.", "local: does not run in CI."]

0 comments on commit 8d311a5

Please sign in to comment.