Sith/.github/workflows/unittests.yml
Théo DURR b3ad5c5df9
Unit tests do not run on master push
They are only trigerred on PRs
2022-08-26 16:12:17 +02:00

65 lines
1.5 KiB
YAML

name: Unit Testing
on:
pull_request:
branches: [ master ]
jobs:
unittests:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gettext libxapian-dev libgraphviz-dev
- name: Install poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Checking pyproject.toml syntax
run: poetry check
- name: Install project
run: poetry install -E testing
- name: Setup xapian index
run: |
mkdir -p /dev/shm/search_indexes
ln -s /dev/shm/search_indexes sith/search_indexes
- name: Setup project
run: poetry run ./manage.py compilemessages
- name: Launch tests and generate coverage report
run: |
poetry run coverage run ./manage.py test
poetry run coverage report
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install black
run: |
python -m pip install --upgrade pip
python -m pip install black==22.6.0
- name: Check linting
run: black --check .