-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
9,815 additions
and
1,737 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Check changes to static files | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
changed_files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: List changed frontend source files | ||
uses: tj-actions/changed-files@v44 | ||
id: changed-frontend-src-files | ||
with: | ||
files: | | ||
frontend/src/**/*.tsx | ||
frontend/src/**/*.css | ||
- name: List changed frontend static files | ||
id: changed-frontend-static-files | ||
if: steps.changed-frontend-src-files.outputs.files_changed == 'true' | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
static | ||
- name: Check changed static files | ||
if: steps.changed-frontend-src-files.outputs.files_changed == 'true' && steps.changed-frontend-static-files.outputs.files_changed == 'false' | ||
run: echo "There were changes to the frontend code, but no corresponding changes to static files. Please build the project locally, commit the static file changes and push the changes to try again." && exit 1 | ||
|
||
- name: List logo customizations | ||
uses: tj-actions/changed-files@v44 | ||
id: changed-logo-files | ||
with: | ||
files: | | ||
frontend/public/favicon.ico | ||
frontend/src/assets | ||
- name: Comment on logo customizations | ||
if: steps.changed-logo-files.outputs.any_changed == 'true' | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
"Hello contributor, it appears that your pull request contains some customizations to branding. We are unable to approve your PR at this time. If you believe this message to be in error, please correct these unsupported changes and try again, or reach out to one of the maintainers of the repo to discuss the changes." | ||
- name: Fail on logo customizations | ||
if: steps.changed-logo-files.outputs.any_changed == 'true' | ||
run: echo "Logos are customized, which is not a supported change." && exit 1 |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Docker Image Build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: | ||
docker build . --file WebApp.Dockerfile --tag sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,60 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
build: | ||
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 | ||
runs-on: ubuntu-latest | ||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
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 | ||
|
@@ -26,9 +76,8 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
pip install -r requirements-dev.txt | ||
- name: Test with pytest | ||
run: | | ||
export PYTHONPATH=$(pwd) | ||
pytest -v --show-capture=stdout | ||
$env:PYTHONPATH=$pwd | ||
pytest -v --show-capture=stdout -k "not integration" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Close inactive issues | ||
on: | ||
schedule: | ||
- cron: "30 1 * * *" | ||
|
||
jobs: | ||
close-issues: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/stale@v5 | ||
with: | ||
days-before-issue-stale: 60 | ||
days-before-issue-close: 14 | ||
stale-issue-label: "stale" | ||
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." | ||
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." | ||
days-before-pr-stale: 60 | ||
days-before-pr-close: 14 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.