Skip to content

Commit 9ab6034

Browse files
committed
Try again
1 parent acc1667 commit 9ab6034

File tree

2 files changed

+117
-25
lines changed

2 files changed

+117
-25
lines changed

.github/workflows/python-app.yml

Lines changed: 116 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,124 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
4-
name: Python application
1+
name: Build and Test Python App
52

63
on:
74
push:
8-
branches: [ "main" ]
5+
branches:
6+
- main
7+
- AddQueryStringForInitialPrompting
98
pull_request:
10-
branches: [ "main" ]
11-
12-
permissions:
13-
contents: read
9+
branches:
10+
- main
11+
- AddQueryStringForInitialPrompting
12+
workflow_dispatch:
1413

1514
jobs:
16-
1715
test_windows:
18-
runs-on:
19-
- windows-latest
16+
runs-on: windows-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python version
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Create and start virtual environment
26+
run: |
27+
python -m venv venv
28+
venv\Scripts\Activate
29+
30+
- name: Install dependencies
31+
run: pip install -r requirements.txt
32+
33+
- name: Run tests
34+
run: |
35+
export PYTHONPATH=$(pwd)
36+
pytest
37+
38+
test_linux:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
43+
- name: Set up Python 3.11
44+
uses: actions/setup-python@v3
45+
with:
46+
python-version: "3.11"
47+
48+
- name: Create and start virtual environment
49+
run: |
50+
python -m venv venv
51+
source venv/bin/activate
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install -r requirements-dev.txt
57+
58+
- name: Test with pytest
59+
env:
60+
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZUREOPENAIENDPOINT }}
61+
AZURE_OPENAI_MODEL: ${{ secrets.AZUREOPENAIMODEL }}
62+
AZURE_OPENAI_KEY: ${{ secrets.AZUREOPENAIKEY }}
63+
AZURE_OPENAI_EMBEDDING_NAME: ${{ secrets.AZUREOPENAIEMBEDDINGNAME }}
64+
AZURE_COSMOSDB_ACCOUNT: ${{ secrets.AZURECOSMOSDBACCOUNT }}
65+
AZURE_COSMOSDB_DATABASE: ${{ secrets.AZURECOSMOSDBDATABASE }}
66+
AZURE_COSMOSDB_CONVERSATIONS_CONTAINER: ${{ secrets.AZURECOSMOSDBCONTAINER }}
67+
AZURE_COSMOSDB_ACCOUNT_KEY: ${{ secrets.AZURECOSMOSDBACCOUNTKEY }}
68+
AZURE_SEARCH_SERVICE: ${{ secrets.AZURESEARCHSERVICE }}
69+
AZURE_SEARCH_INDEX: ${{ secrets.AZURESEARCHINDEX }}
70+
AZURE_SEARCH_KEY: ${{ secrets.AZURESEARCHKEY }}
71+
AZURE_SEARCH_QUERY: ${{ secrets.AZURESEARCHQUERY }}
72+
ELASTICSEARCH_EMBEDDING_MODEL_ID: ${{ secrets.ELASTICSEARCHEMBEDDINGMODELID }}
73+
ELASTICSEARCH_ENCODED_API_KEY: ${{ secrets.ELASTICSEARCHENCODEDAPIKEY }}
74+
ELASTICSEARCH_ENDPOINT: ${{ secrets.ELASTICSEARCHENDPOINT }}
75+
ELASTICSEARCH_INDEX: ${{ secrets.ELASTICSEARCHINDEX }}
76+
ELASTICSEARCH_QUERY: ${{ secrets.ELASTICSEARCHQUERY }}
77+
run: |
78+
export PYTHONPATH=$(pwd)
79+
coverage run -m pytest -v --show-capture=stdout
80+
coverage report -m --include=app.py,backend/*,tests/*
81+
coverage xml
82+
83+
- name: Code Coverage Report
84+
uses: irongut/CodeCoverageSummary@v1.3.0
85+
with:
86+
filename: coverage.xml
87+
badge: true
88+
fail_below_min: true
89+
format: markdown
90+
hide_branch_rate: false
91+
hide_complexity: true
92+
indicators: true
93+
output: both
94+
thresholds: '50 80'
95+
96+
deploy:
97+
runs-on: ubuntu-latest
98+
needs: [test_windows, test_linux]
99+
if: github.ref == 'refs/heads/main'
20100
steps:
21-
- uses: actions/checkout@v3
22-
- name: Set up Python 3.11
23-
uses: actions/setup-python@v3
24-
with:
25-
python-version: "3.11"
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install -r requirements-dev.txt
30-
- name: Test with pytest
31-
run: |
32-
$env:PYTHONPATH=$pwd
33-
pytest -v --show-capture=stdout -k "not integration"
101+
- name: Checkout code
102+
uses: actions/checkout@v3
103+
104+
- name: Download artifact from build job
105+
uses: actions/download-artifact@v3
106+
with:
107+
name: python-app
108+
109+
- name: Unzip artifact for deployment
110+
run: unzip release.zip
111+
112+
- name: Login to Azure
113+
uses: azure/login@v1
114+
with:
115+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID }}
116+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID }}
117+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID }}
118+
119+
- name: 'Deploy to Azure Web App'
120+
uses: azure/webapps-deploy@v2
121+
id: deploy-to-webapp
122+
with:
123+
app-name: 'sample-app-github-cd'
124+
slot-name: 'Production'

frontend/src/pages/chat/Chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const Chat = () => {
9797
const params: string[] = [];
9898
query.forEach((value, key) => {
9999
params.push(`${key}: ${value}`);
100+
console.log(`${key}: ${value}`);
100101
});
101102
setQueryParams(params.join("\n"));
102103

0 commit comments

Comments
 (0)