Try to use Nix in Github actions

This commit is contained in:
Andreas Zweili 2022-11-21 23:09:07 +01:00
parent fe1f233f2f
commit bf2a167089
1 changed files with 7 additions and 11 deletions

View File

@ -12,21 +12,17 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
- name: Enable Nix shell
run: |
python -m pip install --upgrade pip
pip install -r requirements/local.txt
nix develop
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Test with pytest
run: |
pytest -nauto --ds=network_inventory.settings.ram_test --nomigrations
pytest --ds=network_inventory.settings.ram_test -nauto --nomigrations --cov=.