EOS/.github/workflows/pytest.yml
Bobby Noelte 4284119352 Add test for server
A test fixture to start the server and a first test case is added.

The fixture tries to assure that the server is installed and running.
If it is not installed the fixture uses pip to install it.

The server and the installation by pip is run bei the same Python
executable that also runs pytest.

The github workflow for pytest is adapted to install akkudoktor-eos.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-08 19:22:16 +02:00

32 lines
699 B
YAML

name: Run Pytest on Pull Request
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
sudo apt install -y libmariadb3 libmariadb-dev
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run Pytest
run: |
pip install -e .
python -m pytest -vs --cov modules --cov-report term-missing tests/