diff --git a/.circleci/config.yml b/.circleci/config.yml index 6537abd1c..52bc8ab40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,16 @@ jobs: steps: - checkout + + - run: + name: Check if litellm dir was updated or if pyproject.toml was modified + command: | + if [ -n "$(git diff --name-only $CIRCLE_SHA1^..$CIRCLE_SHA1 | grep -E 'pyproject\.toml|litellm/')" ]; then + echo "litellm updated" + else + echo "No changes to litellm or pyproject.toml. Skipping tests." + circleci step halt + fi - restore_cache: keys: - v1-dependencies-{{ checksum ".circleci/requirements.txt" }} @@ -45,6 +55,13 @@ jobs: paths: - ./venv key: v1-dependencies-{{ checksum ".circleci/requirements.txt" }} + - run: + name: Run prisma ./entrypoint.sh + command: | + set +e + chmod +x entrypoint.sh + ./entrypoint.sh + set -e - run: name: Black Formatting command: | @@ -56,28 +73,13 @@ jobs: name: Linting Testing command: | cd litellm - python -m pip install mypy types-requests types-setuptools types-redis types-PyYAML + python -m pip install types-requests types-setuptools types-redis types-PyYAML if ! python -m mypy . --ignore-missing-imports; then echo "mypy detected errors" exit 1 fi cd .. - - run: - name: Check if litellm dir was updated or if pyproject.toml was modified - command: | - if [ -n "$(git diff --name-only $CIRCLE_SHA1^..$CIRCLE_SHA1 | grep -E 'pyproject\.toml|litellm/')" ]; then - echo "litellm updated" - else - echo "No changes to litellm or pyproject.toml. Skipping tests." - circleci step halt - fi - - run: - name: Run prisma ./entrypoint.sh - command: | - set +e - chmod +x entrypoint.sh - ./entrypoint.sh - set -e + # Run pytest and generate JUnit XML report - run: