From bf2a1670893d9c2f22ed38e1b61713409ad50d35 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 21 Nov 2022 23:09:07 +0100 Subject: [PATCH] Try to use Nix in Github actions --- .github/workflows/tests.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87f92bf..bb5638b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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=.