Skip to content

Commit

Permalink
feat: Updated workflows and added badges (#13)
Browse files Browse the repository at this point in the history
* Updated workflows and added badges

* Updated makefile

* Updates

* Updates

* Updates

* Updates

* Updates

* Added downloads badge
  • Loading branch information
Pringled authored Nov 10, 2024
1 parent 68758e2 commit 0b98095
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Run tests and upload coverage

on:
push

jobs:
test:
name: Run tests with pytest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
exclude:
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.12"
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

# Step for Windows: Create and activate a virtual environment
- name: Create and activate a virtual environment (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
irm https://astral.sh/uv/install.ps1 | iex
$env:Path = "C:\Users\runneradmin\.local\bin;$env:Path"
uv venv .venv
"VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append
"$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
# Step for Unix: Create and activate a virtual environment
- name: Create and activate a virtual environment (Unix)
if: ${{ runner.os != 'Windows' }}
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
# Install dependencies using uv pip
- name: Install dependencies
run: make install-no-pre-commit

# Run tests with coverage
- name: Run tests under coverage
run: |
coverage run -m pytest
coverage report
# Upload results to Codecov
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ install: venv
uv sync --all-extras
uv run pre-commit install

install-no-pre-commit:
uv pip install ".[dev,hnsw,pynndescent]"

install-base:
uv sync --extra dev

fix:
uv run pre-commit run --all-files

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@

</div>


<div align="center">
<h2>
<a href="https://pypi.org/project/vicinity/"><img src="https://img.shields.io/pypi/v/vicinity?color=%23007ec6&label=pypi%20package" alt="Package version"></a>
<a href="https://pypi.org/project/vicinity/"><img src="https://img.shields.io/pypi/pyversions/vicinity" alt="Supported Python versions"></a>
<a href="https://pepy.tech/project/model2vec">
<img src="https://static.pepy.tech/badge/vicinity" alt="Downloads">
</a>
<a href="https://app.codecov.io/gh/MinishLab/vicinity">
<img src="https://codecov.io/gh/MinishLab/vicinity/graph/badge.svg?token=0MQ2945OZL" alt="Codecov">
</a>
<a href="https://github.com/MinishLab/vicinity/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="License - MIT"></a>
</h2>
</div>


## Table of contents

- [Quickstart](#quickstart)
Expand Down

0 comments on commit 0b98095

Please sign in to comment.