diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..aff2fed --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/notebooks/how_to/load_server_data.ipynb b/notebooks/how_to/load_server_data.ipynb index 70c1ce3..60ca070 100644 --- a/notebooks/how_to/load_server_data.ipynb +++ b/notebooks/how_to/load_server_data.ipynb @@ -90,7 +90,9 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" - } + }, + "markers": ["local"] + }, "nbformat": 4, "nbformat_minor": 2 diff --git a/pyproject.toml b/pyproject.toml index 47914db..8f8c29f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] @@ -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] @@ -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."]