-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (42 loc) · 1.56 KB
/
pytest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Pytest
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install apt dependencies
run: |
sudo apt-get -y install python3-apt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Test with pytest
env:
SETTINGS_MODULE: vnet_manager.settings.test
PYTHONPATH: "/usr/lib/python${{ matrix.python-version }}/dist-packages:/usr/lib/python3.8/dist-packages:/usr/lib/python3/dist-packages:${PYTHONPATH}"
PYTHONDONTWRITEBYTECODE: 1
run: |
pytest --cov vnet_manager --cov-report term --cov-report xml:coverage.xml
- name: Run the yamllint over all the YAML files
env:
PYTHONPATH: ".:${PYTHONPATH}"
run: |
python3 tools/yaml_syntax_validator.py
- name: Analysing the code with pylint
run: |
pylint vnet_manager
- name: Push to codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true