Skip to content

Fix 790

Fix 790 #1785

name: On pull request
on: [pull_request] # set to this value when pushing in prod
#on: [push] # set this one for dev the ci/cd
env:
DJANGO_SETTINGS_MODULE: Squest.settings
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
poetry-version: ['1.8.0']
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libuv1-dev
sudo apt install -y default-libmysqlclient-dev gcc npm libldap2-dev libsasl2-dev graphviz libsqlite3-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
poetry install
- name: Run Tests
run: |
poetry run coverage run --source='.' manage.py test
- name: Run coverage report
run: |
poetry run coverage report
- name: Generate HTML report
run: |
poetry run coverage html
- name: Generate lcov report
run: |
poetry run coverage lcov
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: htmlcov
path: htmlcov
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov