Sith/.github/workflows/unittests.yml

64 lines
1.4 KiB
YAML
Raw Normal View History

2022-08-25 19:14:04 +00:00
name: Unit Testing Action
on: [push]
jobs:
unittest:
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 dependencies
run: |
2022-08-25 19:19:23 +00:00
sudo apt-get update
sudo apt-get install gettext libxapian-dev libgraphviz-dev
2022-08-25 19:14:04 +00:00
- name: Install poetry
run: |
2022-08-25 19:21:12 +00:00
python -m pip install --upgrade pip
2022-08-25 19:14:04 +00:00
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: |
2022-08-25 19:21:12 +00:00
python -m pip install --upgrade pip
2022-08-25 19:14:04 +00:00
python -m pip install black==22.6.0
- name: Check linting
2022-08-25 19:23:48 +00:00
run: black --check .
2022-08-25 19:17:19 +00:00