Skip to content

Commit

Permalink
tests: adding runner for ROOT
Browse files Browse the repository at this point in the history
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
  • Loading branch information
henryiii committed Jun 11, 2021
1 parent 764bbef commit bb9249b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 5 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -26,6 +26,7 @@ jobs:
checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
Expand All @@ -36,7 +37,6 @@ jobs:
- python-version: pypy-3.7
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v2

Expand All @@ -47,16 +47,41 @@ jobs:
- name: Install package
run: python -m pip install .[test]

- name: Test package
- name: Test
run: python -m pytest -ra

root:
name: ROOT test
runs-on: ubuntu-latest
needs: [pre-commit]
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
use-mamba: true
environment-file: environment.yml

- name: Install package
run: pip install .

- name: Test root
run: pytest -ra tests/test_root.py



dist:
name: Distribution build
runs-on: ubuntu-latest
needs: [pre-commit]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Build sdist and wheel
run: pipx run build
Expand Down
9 changes: 9 additions & 0 deletions environment.yml
@@ -0,0 +1,9 @@
name: uhi
channels:
- conda-forge
dependencies:
- pip
- pytest
- root
- pytest
- boost-histogram
15 changes: 13 additions & 2 deletions noxfile.py
Expand Up @@ -17,7 +17,7 @@ def lint(session):
Run the linter.
"""
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files")
session.run("pre-commit", "run", "--all-files", *session.posargs)


@nox.session(python=ALL_PYTHONS)
Expand All @@ -26,7 +26,7 @@ def tests(session):
Run the unit and regular tests.
"""
session.install(".[test]")
session.run("pytest")
session.run("pytest", *session.posargs)


@nox.session
Expand Down Expand Up @@ -63,3 +63,14 @@ def build(session):

session.install("build")
session.run("python", "-m", "build")


@nox.session(venv_backend="conda")
def root_tests(session):
"""
Test against ROOT.
"""

session.conda_install("--channel=conda-forge", "ROOT", "pytest", "boost-histogram")
session.install(".")
session.run("pytest", "tests/test_root.py")
7 changes: 7 additions & 0 deletions tests/test_root.py
@@ -0,0 +1,7 @@
import pytest

ROOT = pytest.importorskip("ROOT")


def test_root_imported():
assert ROOT.TString("hi") == "hi"

0 comments on commit bb9249b

Please sign in to comment.