Skip to content

Qa nico 2

Qa nico 2 #1508

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.10']
poetry-version: ['1.3.2']
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/actions-poetry@v2.0.0
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@v2
with:
name: htmlcov
path: htmlcov
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov