Skip to content

Commit

Permalink
ci: Initial github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjchambers committed Jan 16, 2025
1 parent 77dbf34 commit be7fcd4
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/actions/setup-python-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Setup Python Environment"
description: "Set up Python environment for the given Python version"

inputs:
python-version:
description: "Python version to use"
required: true
default: "3.12"
uv-version:
description: "uv version to use"
required: true
default: "0.4.6"

runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: ${{ inputs.uv-version }}
enable-cache: "true"
cache-suffix: ${{ matrix.python-version }}

- name: Install Python dependencies
run: uv sync --frozen
shell: bash
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Main

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

# TODO: Caching

- name: Set up the environment
uses: ./.github/actions/setup-python-env
id: setup

- name: Run `make fmt-check`
run: make fmt-check
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }}

- name: Run `make check`
run: make check
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }}

- name: Run `make check-lock`
run: make check-lock
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }}

- name: Run `make deptry`
run: make deptry
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }}

tests-and-type-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v4

- name: Set up the environment
uses: ./.github/actions/setup-python-env
with:
python-version: ${{ matrix.python-version }}

- name: Run `make test`
run: make test

- name: Run `make mypy`
run: make mypy

- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11
uses: codecov/codecov-action@v4
if: ${{ matrix.python-version == '3.11' }}

# check-docs:
# runs-on: ubuntu-latest
# steps:
# - name: Check out
# uses: actions/checkout@v4

# - name: Set up the environment
# uses: ./.github/actions/setup-python-env

# - name: Check if documentation can be built
# run: uv run mkdocs build -s
15 changes: 15 additions & 0 deletions .github/workflows/validate-codecov-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: validate-codecov-config

on:
pull_request:
paths: [codecov.yaml]
push:
branches: [main]

jobs:
validate-codecov-config:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Validate codecov configuration
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ simsimd = [
beautifulsoup4 = "bs4"
opensearch-py = "opensearchpy"

[tool.deptry.per_rule_ignores]
DEP002 = ["cassio"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
pythonpath = ["."]
Expand Down

0 comments on commit be7fcd4

Please sign in to comment.