Skip to content

Commit

Permalink
Merge pull request #60 from dewitt4/circle_config
Browse files Browse the repository at this point in the history
Update config.yml
  • Loading branch information
dewitt4 authored Nov 27, 2024
2 parents 8961fda + 8a61b77 commit 9057ed4
Showing 1 changed file with 65 additions and 22 deletions.
87 changes: 65 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,82 @@
# .circleci/config.yml
version: 2.1

jobs:
build-and-test:
orbs:
python: circleci/python@2.1
codecov: codecov/codecov@3.2

executors:
python-executor:
docker:
- image: cimg/python:3.9
- image: cimg/python:3.8

commands:
install-dependencies:
steps:
- python/install-packages:
pkg-manager: pip
packages:
- -r requirements/dev.txt
- -r requirements/test.txt

jobs:
lint:
executor: python-executor
steps:
- checkout

# Set up Python virtual environment and install dependencies
- install-dependencies
- run:
name: Install Dependencies
command: |
python -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
name: Run black
command: black --check src tests
- run:
name: Run flake8
command: flake8 src tests
- run:
name: Run isort
command: isort --check-only src tests
- run:
name: Run mypy
command: mypy src

# Run tests
test:
executor: python-executor
steps:
- checkout
- install-dependencies
- run:
name: Run Tests
name: Run tests with coverage
command: |
. venv/bin/activate
python -m pytest tests/ -v
# Store test results
pytest --cov=llmguardian --cov-report=xml tests/
- codecov/upload:
file: coverage.xml
- store_test_results:
path: test-results

# Store test artifacts
- store_artifacts:
path: test-results
destination: tr1

build:
executor: python-executor
steps:
- checkout
- install-dependencies
- run:
name: Build package
command: python setup.py sdist bdist_wheel
- store_artifacts:
path: dist
destination: dist

workflows:
main:
version: 2
build-test-deploy:
jobs:
- build-and-test
- lint
- test:
requires:
- lint
- build:
requires:
- test
filters:
branches:
only: main

0 comments on commit 9057ed4

Please sign in to comment.