Skip to content

backend: local unit tests #33

backend: local unit tests

backend: local unit tests #33

name: Backend unit tests
on:
push:
branches: [main]
pull_request: {}
merge_group: {}
jobs:
pytest:
permissions: write-all
# environment: development
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
pip install poetry==1.2.2
poetry install --with dev
- name: Setup Docker
run: make test-db
- name: Test with pytest
if: github.actor != 'dependabot[bot]'
run: |
make run-unit-tests
# - name: Run unit tests
# if: github.actor != 'dependabot[bot]'
# run: |
# mkdir -p coverage
# docker compose build --build-arg INSTALL_COMMUNITY_DEPS=true backend
# docker compose run --name backend-container -v $(pwd)/coverage:/app/coverage backend poetry run pytest --cov=src/backend --cov-report=xml:/app/coverage/coverage.xml src/backend/tests/unit
# - name: Upload coverage reports to Codecov
# uses: codecov/[email protected]
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: coverage/coverage.xml