diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..05fdeb9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: Tests + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + pip install pytest pytest-cov pytest-testmon + + - name: Run tests (optimized with testmon) + run: | + pytest umap/tests/ -v --cov=umap --cov-report=xml --testmon + continue-on-error: true + + - name: Run full test suite if optimized run failed + if: failure() + run: | + pytest umap/tests/ -v --cov=umap --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./coverage.xml + fail_ci_if_error: false diff --git a/pyproject.toml b/pyproject.toml index bbaf975..b3268c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ plot = [ ] parametric_umap = ["tensorflow >= 2.1"] tbb = ["tbb >= 2019.0"] -test = ["pytest"] +test = ["pytest", "pytest-testmon", "pytest-watch"] [tool.setuptools] packages = ["umap"]