Skip to content

Commit 70afb69

Browse files
Resolve conflicts with main; address review feedback in api.py, ai_chatbot.py, web_demo.py and test_chatbot.py
Co-authored-by: joshuvavinith <146979257+joshuvavinith@users.noreply.github.com>
1 parent 33e1b68 commit 70afb69

7 files changed

Lines changed: 324 additions & 158 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,66 @@ on:
66
pull_request:
77
branches: ["main", "master"]
88

9-
# Restrict default GITHUB_TOKEN permissions to read-only
109
permissions:
1110
contents: read
1211

1312
jobs:
14-
lint-and-test:
13+
lint:
1514
runs-on: ubuntu-latest
16-
permissions:
17-
contents: read
1815

1916
steps:
2017
- uses: actions/checkout@v4
2118

22-
- name: Set up Python
19+
- name: Set up Python 3.12
2320
uses: actions/setup-python@v5
2421
with:
2522
python-version: "3.12"
23+
cache: "pip"
24+
25+
- name: Install flake8
26+
run: pip install flake8
27+
28+
- name: Lint — blocking (syntax errors / undefined names)
29+
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
30+
31+
- name: Lint — style warnings (non-blocking)
32+
run: flake8 . --count --exit-zero --max-line-length=100 --statistics
33+
34+
test:
35+
needs: lint
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
python-version: ["3.10", "3.11", "3.12"]
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
cache: "pip"
2649

2750
- name: Install dependencies
2851
run: |
2952
python -m pip install --upgrade pip
3053
pip install -r requirements.txt
3154
32-
- name: Lint with flake8
33-
run: |
34-
pip install flake8
35-
# Stop the build if there are Python syntax errors or undefined names
36-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37-
# Treat all other issues as warnings (non-blocking)
38-
flake8 . --count --exit-zero --max-line-length=100 --statistics
55+
- name: Run tests with coverage
56+
env:
57+
OPENAI_API_KEY: "offline-mode-no-key-required"
58+
run: pytest test_chatbot.py -v --tb=short --cov=. --cov-report=xml
3959

40-
- name: Run tests
41-
run: pytest test_chatbot.py -v
60+
- name: Upload coverage report
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: coverage-${{ matrix.python-version }}
64+
path: coverage.xml
4265

4366
docker-build:
67+
needs: test
4468
runs-on: ubuntu-latest
45-
needs: lint-and-test
46-
permissions:
47-
contents: read
4869

4970
steps:
5071
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)