update readme and fix CI (#15) #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run full test suite using conda env and all optional deps. | |
name: TestCode | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'pyproject.toml' | |
- '**.py' | |
- '.github/workflows/*.yml' | |
# Cancel previous runs when this one starts. | |
concurrency: | |
group: TestCode-${{ github.event.pull_request.number || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# Runs the tests on combinations of the supported python/os matrix. | |
test_code: | |
timeout-minutes: 25 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.10', '3.11', "3.12"] | |
# only run if CI isn't turned off | |
if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci') | |
env: | |
# set conda environment file with dependencies | |
env_file: "test_conda_env.yml" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "get tags" | |
run: | | |
git fetch --tags --force # Retrieve annotated tags. | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
# Print out the package info for current environment | |
- name: print package info | |
shell: bash -el {0} | |
run: | | |
uv pip list | |
- name: Run tests | |
# For example, using `pytest` | |
run: uv run pytest -s --cov dbscan1d --cov-append --cov-report=xml | |
# Upload coverage files | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false | |
files: ./coverage.xml | |
flags: unittests | |
name: PR_tests | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# This is a very useful step for debugging, it allows you to ssh into the CI | |
# machine (https://github.com/marketplace/actions/debugging-with-tmate). | |
# | |
#- name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 |