Avoid testing models that need a GPU on CI #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: LLM App | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# from: https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 | |
- name: Delete huge unnecessary tools folder | |
run: rm -rf /opt/hostedtoolcache | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Cache pip packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('llm_app/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Ruff | |
run: | | |
python -m pip install ruff | |
ruff check . && ruff format --check . | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install torch | |
python -m pip install pytest deepdiff pillow openai transformers llama-cpp-python "fastapi[standard]" | |
python -m pip install -e llmlib | |
- name: Run tests | |
run: pytest test* | |
env: | |
OPENAI_API_KEY: "nothing" | |
LLMS_REST_API_KEY: "some-api-key" | |
BUGSNAG_API_KEY: "nothing" |