Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions .circleci/config.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: test-workflow

on: [push, pull_request, workflow_dispatch]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot trigger on push only

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 912ef03. Workflow now triggers on push events only.


permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-24.04
container:
image: python:3.10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install -r requirements-lint.txt
- name: Black
run: |
black --check .
- name: Ruff
run: |
ruff cleancat tests

test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
services:
mongo:
image: mongo:6.0.18
options: >-
--health-cmd "echo 'db.runCommand(\"ping\").ok' | mongosh --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017
container:
image: python:${{ matrix.python-version }}
env:
MONGODB_HOST: mongo
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Test
run: |
pytest
6 changes: 5 additions & 1 deletion tests/test_mongo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest
from bson import ObjectId
from mongoengine import Document, EmbeddedDocument, StringField, connect
Expand All @@ -12,7 +14,9 @@

@pytest.fixture()
def _mongodb():
connect(db="cleancat_test")
connect(
db="cleancat_test", host=os.environ.get("MONGODB_HOST", "localhost")
)


@pytest.fixture()
Expand Down