Merge pull request #61 from Erik-Lamers1/pin-older-request #152
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |