Spaces:
Runtime error
Runtime error
trying out github actions
Browse files- .github/workflows/ci.yml +81 -0
.github/workflows/ci.yml
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: ["*"]
|
| 6 |
+
pull_request:
|
| 7 |
+
branches: [main]
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
lint:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
steps:
|
| 13 |
+
- uses: actions/checkout@v4
|
| 14 |
+
|
| 15 |
+
- name: Set up Python
|
| 16 |
+
uses: actions/setup-python@v5
|
| 17 |
+
with:
|
| 18 |
+
python-version: "3.11"
|
| 19 |
+
|
| 20 |
+
- name: Install ruff
|
| 21 |
+
run: pip install ruff
|
| 22 |
+
|
| 23 |
+
- name: Lint
|
| 24 |
+
run: ruff check rag_pipeline/
|
| 25 |
+
|
| 26 |
+
type-check:
|
| 27 |
+
runs-on: ubuntu-latest
|
| 28 |
+
steps:
|
| 29 |
+
- uses: actions/checkout@v4
|
| 30 |
+
|
| 31 |
+
- name: Set up Python
|
| 32 |
+
uses: actions/setup-python@v5
|
| 33 |
+
with:
|
| 34 |
+
python-version: "3.11"
|
| 35 |
+
|
| 36 |
+
- name: Install mypy
|
| 37 |
+
run: pip install mypy
|
| 38 |
+
|
| 39 |
+
- name: Type check
|
| 40 |
+
run: mypy rag_pipeline/ --ignore-missing-imports
|
| 41 |
+
|
| 42 |
+
security:
|
| 43 |
+
runs-on: ubuntu-latest
|
| 44 |
+
steps:
|
| 45 |
+
- uses: actions/checkout@v4
|
| 46 |
+
|
| 47 |
+
- name: Set up Python
|
| 48 |
+
uses: actions/setup-python@v5
|
| 49 |
+
with:
|
| 50 |
+
python-version: "3.11"
|
| 51 |
+
|
| 52 |
+
- name: Install bandit
|
| 53 |
+
run: pip install bandit
|
| 54 |
+
|
| 55 |
+
- name: Security scan
|
| 56 |
+
run: bandit -r rag_pipeline/ -ll
|
| 57 |
+
|
| 58 |
+
test:
|
| 59 |
+
runs-on: ubuntu-latest
|
| 60 |
+
steps:
|
| 61 |
+
- uses: actions/checkout@v4
|
| 62 |
+
|
| 63 |
+
- name: Set up Python
|
| 64 |
+
uses: actions/setup-python@v5
|
| 65 |
+
with:
|
| 66 |
+
python-version: "3.11"
|
| 67 |
+
|
| 68 |
+
- name: Cache pip
|
| 69 |
+
uses: actions/cache@v4
|
| 70 |
+
with:
|
| 71 |
+
path: ~/.cache/pip
|
| 72 |
+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
| 73 |
+
restore-keys: ${{ runner.os }}-pip-
|
| 74 |
+
|
| 75 |
+
- name: Install dependencies
|
| 76 |
+
run: pip install -r requirements.txt
|
| 77 |
+
|
| 78 |
+
- name: Run tests
|
| 79 |
+
run: pytest tests/ -v
|
| 80 |
+
env:
|
| 81 |
+
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|