Test Suite #168
Workflow file for this run
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
name: Run Tests | |
on: [pull_request] | |
jobs: | |
test: | |
permissions: | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: 'poetry' | |
- name: Start Database | |
run: | | |
cp .env.template .env | |
docker compose -f docker-compose.yml.example up database -d | |
- name: Run Tests | |
run: | | |
sudo chown -R runner:docker data && sudo chmod -R 755 data | |
ls -alR data | |
ls -alR data/pgdata | |
poetry install --no-root | |
poetry run coverage run -m pytest -vv -s | |
poetry run coverage report --format=markdown > coverage.md | |
echo -e "\n---\n# Docstring Coverage\n\`\`\`" >> coverage.md | |
poetry run interrogate -v honcho >> coverage.md | |
echo -e "\`\`\`" >> coverage.md | |
env: | |
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} | |
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | |
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }} | |
AZURE_OPENAI_EMBED_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_EMBED_DEPLOYMENT }} | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
recreate: true | |
path: sdk/coverage.md | |
- name: Stop Database | |
run: | | |
docker compose down |