-
Notifications
You must be signed in to change notification settings - Fork 2.8k
83 lines (77 loc) · 2.83 KB
/
python-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
test_linux:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Test with pytest
env:
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZUREOPENAIENDPOINT }}
AZURE_OPENAI_MODEL: ${{ secrets.AZUREOPENAIMODEL }}
AZURE_OPENAI_KEY: ${{ secrets.AZUREOPENAIKEY }}
AZURE_OPENAI_EMBEDDING_NAME: ${{ secrets.AZUREOPENAIEMBEDDINGNAME }}
AZURE_COSMOSDB_ACCOUNT: ${{ secrets.AZURECOSMOSDBACCOUNT }}
AZURE_COSMOSDB_DATABASE: ${{ secrets.AZURECOSMOSDBDATABASE }}
AZURE_COSMOSDB_CONVERSATIONS_CONTAINER: ${{ secrets.AZURECOSMOSDBCONVERSATIONSCONTAINER }}
AZURE_COSMOSDB_ACCOUNT_KEY: ${{ secrets.AZURECOSMOSDBACCOUNTKEY }}
AZURE_SEARCH_SERVICE: ${{ secrets.AZURESEARCHSERVICE }}
AZURE_SEARCH_INDEX: ${{ secrets.AZURESEARCHINDEX }}
AZURE_SEARCH_KEY: ${{ secrets.AZURESEARCHKEY }}
AZURE_SEARCH_QUERY: ${{ secrets.AZURESEARCHQUERY }}
ELASTICSEARCH_EMBEDDING_MODEL_ID: ${{ secrets.ELASTICSEARCHEMBEDDINGMODELID }}
ELASTICSEARCH_ENCODED_API_KEY: ${{ secrets.ELASTICSEARCHENCODEDAPIKEY }}
ELASTICSEARCH_ENDPOINT: ${{ secrets.ELASTICSEARCHENDPOINT }}
ELASTICSEARCH_INDEX: ${{ secrets.ELASTICSEARCHINDEX }}
ELASTICSEARCH_QUERY: ${{ secrets.ELASTICSEARCHQUERY }}
run: |
export PYTHONPATH=$(pwd)
coverage run -m pytest -v --show-capture=stdout
coverage report -m --include=app.py,backend/*,tests/*
coverage xml
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '50 80'
test_windows:
runs-on:
- windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Test with pytest
run: |
$env:PYTHONPATH=$pwd
pytest -v --show-capture=stdout -k "not integration"