Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Jan 12, 2025
1 parent 1d575f8 commit f07cccf
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run tests

on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
run_tests:
# Skip the entire job for fork PRs
if: ${{ !(github.event.pull_request.head.repo.fork) }}
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.10"]

runs-on: ${{ matrix.os }}

env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

steps:
- uses: actions/checkout@v4

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

- name: download uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Run tests
run: uv run pytest -vv
25 changes: 25 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run static analysis

on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
static_analysis:
timeout-minutes: 1

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Run pre-commit
uses: pre-commit/[email protected]
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
# Ruff version.
rev: v0.9.1
hooks:
- id: ruff-format
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--fix]
# Run the formatter.
- id: ruff-format
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ marvin = "marvin.cli.main:app"

# pytest configuration
[tool.pytest.ini_options]
addopts = "--verbose --color=yes"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
timeout = 10
Expand Down Expand Up @@ -65,7 +66,7 @@ source = "vcs"
extend-select = ["I"]

[tool.ruff.per-file-ignores]
"__init__.py" = ["I"]
"__init__.py" = ["F401"]

[build-system]
requires = ["hatchling>=1.21.0", "hatch-vcs>=0.4.0"]
Expand Down
1 change: 1 addition & 0 deletions tests/basic/memory/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ def test_load_from_instance(self, tmp_path):
client=chromadb.PersistentClient(path=str(tmp_path / "test_path")),
)
m = marvin.Memory(key="test", instructions="test", provider=mp)
assert m

0 comments on commit f07cccf

Please sign in to comment.