diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3a453a18..90b57797 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,13 +13,5 @@ jobs: - uses: actions/setup-python@v3 with: python-version: "3.10" - # Step 3: Install dependencies (from requirements.txt or Pipfile) - - name: Install dependencies - run: | - python -m venv venv - source venv/bin/activate - cd model_server - pip install --upgrade pip - pip install -r requirements.txt # Or use pipenv install - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 00000000..e02778a7 --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,39 @@ +name: Run Python Tests + +on: + push: + branches: + - main # Run tests on pushes to the main branch + pull_request: + branches: + - main # Run tests on pull requests to the main branch + +jobs: + test: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the code from your repository + - name: Checkout code + uses: actions/checkout@v3 + + # Step 2: Set up Python (specify the version) + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" # Adjust to your Python version + + # Step 3: Install dependencies (from requirements.txt or Pipfile) + - name: Install dependencies + run: + python -m venv venv + source venv/bin/activate + cd model_server + pip install --upgrade pip + pip install -r requirements.txt # Or use pipenv install + + # Step 4: Set PYTHONPATH and run tests + - name: Run tests with pytest + run: | + export PYTHONPATH=. + pytest --maxfail=5 --disable-warnings diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e0047c75..b43d80ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,11 +28,6 @@ repos: # --lib is to only test the library, since when integration tests are made, # they will be in a seperate tests directory entry: bash -c "cd crates/llm_gateway && cargo test --lib" - - id: python-tests - name: Run Python Tests with pytest - language: system - entry: bash -c "cd model_server && PYTHONPATH=. pytest --maxfail=5 --disable-warnings" - types: [python] - repo: https://github.com/psf/black